Panel Interface Board  1
inszt_fsk.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:51:18 2020
5 */
6 /**************************************************************************************/
24 /**************************************************************************************/
25 /**************************************************************************************/
26 /**************************************************************************************/
27 /* Section: Included Files */
28 /**************************************************************************************/
29 /**************************************************************************************/
30 #define QQQdialect MPLABX
31 #undef QQQ146
32 #undef QQQ148
33 #undef QQQbndchk
34 #undef QQQ294
35 #undef QQQEMBEDDEDICE
36  /* Note: for BITMAP execution histories QQQthreaded is not defined */
37 #undef QQQthreaded
38 #undef QQQdo178b
39 #undef QQQfixbra
40 #define QQQswitch3
41 #undef QQQternary
42 #define QQQswitch
43 #undef QQQmacrof
44 #undef QQQMULTIPROCESSEXH
45 #undef QQFLUSH
46 #undef QQNEWBS
47 #define qqqMaxBranchDepth 20
48 #define QQQstructbitmap
49  static int qqqqbmselwidth = 32 ;
50  static int zzfileid = 60;
51 #define QQQnumfil 23
52 #undef QQQALGONE
53 #undef QQQVCLFLG
54 #undef QQQFORKFL
55 #undef QQQIADDRF
56 #undef QQQRTI
57 #undef QQQPERFA
58 #undef QQQADRMOD
59 #undef QQQDCAPFL
60 #undef QQQTEMPLATEONLY
61 #define QQQNOATEXIT
62 #define QQQUPLOADATEND
63 #define QQQNOSTDIO
64 #undef QQQASHLINGVITRA
65 #define QQQBITMAP
66  #define qqqbitmapint unsigned int
67 #undef QQQBITMAPMCDC
68 #undef QQQTIC2XSERIALIO
69 #undef QQQTIC2XFLASH
70 #undef QQQCOMPRESSED_EXH
71 #undef QQQMAINFL
72 #define QQQSINGLEFILE
73 #define QQQFILEID
74 #define QQQseparate
75 extern int QQQindicator;
76 static int QQQfirstmcdc=1;
77 #define fsk_60zzopen zzopen
78  extern int fsk_60zzopen ;
79 #define fsk_60zqqzqz1 zqqzqz1
80 #define QQQLDRA_PORT
81 #ifndef QQQLDRA_PORT
82 #define FILEPOINT FILE * f,
83 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
84 #include <stdio.h>
85  /* ----------------------------------------------------------------------* 100 *
86  * If stdio.h is not available then insert:
87  * typedef int * FILE;
88  * -----------------------------------------------------------------------------
89  */
90 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
91 #else /* QQQLDRA_PORT */
92 #define FILEPOINT
93 /*************************** LDRA_PORT *********************************/
94 #ifdef QQQ_SHLAYOUT
95 static int tbrun_mode=1;
96 #else
97 static int tbrun_mode=0;
98 #endif /* QQQ_SHLAYOUT */
99 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
100 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
101 #ifndef QQQ_SHLAYOUT
102 #ifdef QQQMAINFL
103 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
104 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
105 #endif /* QQQMAINFL */
106 #endif /* QQQ_SHLAYOUT */
107 /************************ END OF LDRA_PORT *****************************/
108 #endif /* QQQLDRA_PORT */
109 #ifndef QQQnumfil
110 #define QQQnumfil 40 /* default setting */
111 #endif /* QQQnumfil */
112 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
113 #ifndef LDRA_VOID_FUNC
114 #define LDRA_VOID_FUNC
115  typedef void(*ldra_void_function)();
116 #endif
117 #if defined(QQQMAINFL)
118  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
119  through the target you would have to set this to 0 before calling the qqqupload.
120  Move this into ldra_port mechanism. */
121  int qqqshell_upload = 0;
122  int QQQfcn_ptr_num = 0;
123  static int qqqisinitialised = 0;
126  void qqqtotalupload(void);
127  void qqqtotalreset(void);
129  qqqaccumupload[x]=y;
130  qqqaccumreset[x]=z;
131  QQQfcn_ptr_num++;
132  }
133 #else /* (QQQMAINFL) */
134  extern int QQQfcn_ptr_num;
137  static int qqqstructzzopen = 0;
138 #endif /* defined(QQQMAINFL) */
139 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
140 #ifdef QQQ_KEEPCOMMENTS
141  /* -----------------------------------------------------------------------* 101 *
142  * Special settings for systems lacking standard functions.
143  * To include code for fprintf define ldra_fprintf
144  * To include code for sscanf define ldra_sscanf
145  * -----------------------------------------------------------------------------
146  */
147 #endif /* QQQ_KEEPCOMMENTS */
148 #if !defined(QQQSUPPRESS_UNDEF)
149 #undef ldra_fprintf
150 #undef ldra_sscanf
151 #endif /* !defined(QQQSUPPRESS_UNDEF) */
152  /* #define ldra_fprintf */
153  /* #define ldra_sscanf */
154 #undef QQQHITMAP_STORAGE
155 #undef qqnull_params
156 #define qqnull_params void
157 #define QQQ_PROTOTYPE_DEF
158  /* Conventional Instrumentation */
159 #undef QQ_ANSI_PROTOTYPE
160 #ifdef __STDC__
161 #define QQ_ANSI_PROTOTYPE 1
162 #else /* __STDC__ */
163 #ifdef VAXC
164 #define QQ_ANSI_PROTOTYPE 1
165 #endif /* VAXC */
166 #endif /* __STDC__ */
167  static unsigned char qqqzzglobflag = 0;
168  static struct bitmapstruct_t
169  {
170 #define ELEMENT(N) qqqbitmapint element##N;
171 #define LASTELEMENT
172 #include "fsk_60zbelem.def"
173 #undef ELEMENT
174 #undef LASTELEMENT
175  } bitmapstruct = {
176 #define ELEMENT(N) 0,
177 #undef LASTELEMENT
178 #include "fsk_60zbelem.def"
179 #undef ELEMENT
180  0};
181  static void qqoutput(FILEPOINT char * s,int i);
182  static void qqoutput2(FILEPOINT char * s,int i, int j);
183  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
184  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
185  static void qqoutput0(FILEPOINT char * s);
186  static int fsk_60zqqzqz(qqnull_params);
187  static int fsk_60zqqzqz1(qqnull_params);
188  static int fsk_60zqendz (int qqqi);
189  static int fsk_60zqzqzq (int qqqi);
190  static void qqqupload(qqnull_params);
191  static void qqqbitmapreset(qqnull_params);
192 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
193 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h */
194 /**************************************************************************************/
208 /**************************************************************************************/
209 #ifndef FSK_H /* Guard against multiple inclusion */
210 #define FSK_H
211 /**************************************************************************************/
212 /**************************************************************************************/
213 /* Section: Included Files */
214 /**************************************************************************************/
215 /**************************************************************************************/
216 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
217 /*******************************************************************************
218  MPLAB Harmony System Configuration Header
219  File Name:
220  system_config.h
221  Summary:
222  Build-time configuration header for the system defined by this MPLAB Harmony
223  project.
224  Description:
225  An MPLAB Project may have multiple configurations. This file defines the
226  build-time options for a single configuration.
227  Remarks:
228  This configuration header must not define any prototypes or data
229  definitions (or include any files that do). It only provides macro
230  definitions for build-time configuration options that are not instantiated
231  until used by another MPLAB Harmony module or application.
232  Created with MPLAB Harmony Version 2.06
233 *******************************************************************************/
234 // DOM-IGNORE-BEGIN
235 /*******************************************************************************
236 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
237 Microchip licenses to you the right to use, modify, copy and distribute
238 Software only when embedded on a Microchip microcontroller or digital signal
239 controller that is integrated into your product or third party product
240 (pursuant to the sublicense terms in the accompanying license agreement).
241 You should refer to the license agreement accompanying this Software for
242 additional information regarding your rights and obligations.
243 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
244 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
245 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
246 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
247 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
248 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
249 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
250 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
251 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
252 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
253 *******************************************************************************/
254 // DOM-IGNORE-END
255 #ifndef _SYSTEM_CONFIG_H
256 #define _SYSTEM_CONFIG_H
257 // *****************************************************************************
258 // *****************************************************************************
259 // Section: Included Files
260 // *****************************************************************************
261 // *****************************************************************************
262 /* This section Includes other configuration headers necessary to completely
263  define this configuration.
264 */
265 // DOM-IGNORE-BEGIN
266 // DOM-IGNORE-END
267 // *****************************************************************************
268 // *****************************************************************************
269 // Section: System Service Configuration
270 // *****************************************************************************
271 // *****************************************************************************
272 // *****************************************************************************
273 /* Common System Service Configuration Options
274 */
275 #define SYS_VERSION_STR "2.06"
276 #define SYS_VERSION 20600
277 // *****************************************************************************
278 /* Clock System Service Configuration Options
279 */
280 #define SYS_CLK_FREQ 200000000ul
281 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
282 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
283 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
284 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
285 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
286 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
287 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
288 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
289 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
290 /*** Ports System Service Configuration ***/
291 #define SYS_PORT_A_ANSEL 0x3F00
292 #define SYS_PORT_A_TRIS 0xFFED
293 #define SYS_PORT_A_LAT 0x0010
294 #define SYS_PORT_A_ODC 0x0000
295 #define SYS_PORT_A_CNPU 0x0020
296 #define SYS_PORT_A_CNPD 0x0000
297 #define SYS_PORT_A_CNEN 0x0021
298 #define SYS_PORT_B_ANSEL 0x10C8
299 #define SYS_PORT_B_TRIS 0x91FF
300 #define SYS_PORT_B_LAT 0x0000
301 #define SYS_PORT_B_ODC 0x0000
302 #define SYS_PORT_B_CNPU 0x0000
303 #define SYS_PORT_B_CNPD 0x0000
304 #define SYS_PORT_B_CNEN 0x0000
305 #define SYS_PORT_C_ANSEL 0xCFE1
306 #define SYS_PORT_C_TRIS 0xFFFF
307 #define SYS_PORT_C_LAT 0x0000
308 #define SYS_PORT_C_ODC 0x0000
309 #define SYS_PORT_C_CNPU 0x0000
310 #define SYS_PORT_C_CNPD 0x0000
311 #define SYS_PORT_C_CNEN 0x0000
312 #define SYS_PORT_D_ANSEL 0xC100
313 #define SYS_PORT_D_TRIS 0xFFFF
314 #define SYS_PORT_D_LAT 0x0000
315 #define SYS_PORT_D_ODC 0x0000
316 #define SYS_PORT_D_CNPU 0x0000
317 #define SYS_PORT_D_CNPD 0x0000
318 #define SYS_PORT_D_CNEN 0x0000
319 #define SYS_PORT_E_ANSEL 0xFC00
320 #define SYS_PORT_E_TRIS 0xFDFF
321 #define SYS_PORT_E_LAT 0x0000
322 #define SYS_PORT_E_ODC 0x0000
323 #define SYS_PORT_E_CNPU 0x0000
324 #define SYS_PORT_E_CNPD 0x0000
325 #define SYS_PORT_E_CNEN 0x0000
326 #define SYS_PORT_F_ANSEL 0xCEC0
327 #define SYS_PORT_F_TRIS 0xEFFF
328 #define SYS_PORT_F_LAT 0x0000
329 #define SYS_PORT_F_ODC 0x0000
330 #define SYS_PORT_F_CNPU 0x0000
331 #define SYS_PORT_F_CNPD 0x0000
332 #define SYS_PORT_F_CNEN 0x0000
333 #define SYS_PORT_G_ANSEL 0x8CBC
334 #define SYS_PORT_G_TRIS 0xDFFF
335 #define SYS_PORT_G_LAT 0x0000
336 #define SYS_PORT_G_ODC 0x0000
337 #define SYS_PORT_G_CNPU 0x0000
338 #define SYS_PORT_G_CNPD 0x0000
339 #define SYS_PORT_G_CNEN 0x0000
340 #define SYS_PORT_H_ANSEL 0x0070
341 #define SYS_PORT_H_TRIS 0xB3FB
342 #define SYS_PORT_H_LAT 0x0000
343 #define SYS_PORT_H_ODC 0x0000
344 #define SYS_PORT_H_CNPU 0x0000
345 #define SYS_PORT_H_CNPD 0x0000
346 #define SYS_PORT_H_CNEN 0x0000
347 #define SYS_PORT_J_ANSEL 0x0000
348 #define SYS_PORT_J_TRIS 0x8B7F
349 #define SYS_PORT_J_LAT 0x0080
350 #define SYS_PORT_J_ODC 0x0000
351 #define SYS_PORT_J_CNPU 0x0000
352 #define SYS_PORT_J_CNPD 0x0000
353 #define SYS_PORT_J_CNEN 0x0800
354 #define SYS_PORT_K_ANSEL 0xFF00
355 #define SYS_PORT_K_TRIS 0xFFFF
356 #define SYS_PORT_K_LAT 0x0000
357 #define SYS_PORT_K_ODC 0x0000
358 #define SYS_PORT_K_CNPU 0x0000
359 #define SYS_PORT_K_CNPD 0x0000
360 #define SYS_PORT_K_CNEN 0x0000
361 /*** Interrupt System Service Configuration ***/
362 #define SYS_INT true
363 /*** Timer System Service Configuration ***/
364 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
365 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
366 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
367 #define SYS_TMR_FREQUENCY 1000
368 #define SYS_TMR_FREQUENCY_TOLERANCE 10
369 #define SYS_TMR_UNIT_RESOLUTION 10000
370 #define SYS_TMR_CLIENT_TOLERANCE 10
371 #define SYS_TMR_INTERRUPT_NOTIFICATION false
372 // *****************************************************************************
373 // *****************************************************************************
374 // Section: Driver Configuration
375 // *****************************************************************************
376 // *****************************************************************************
377 #define DRV_IC_DRIVER_MODE_STATIC
378 #define USE_8BIT_PMP
379 /*** SPI Driver Configuration ***/
380 #define DRV_SPI_NUMBER_OF_MODULES 6
381 /*** Driver Compilation and static configuration options. ***/
382 /*** Select SPI compilation units.***/
383 #define DRV_SPI_POLLED 1
384 #define DRV_SPI_ISR 0
385 #define DRV_SPI_MASTER 1
386 #define DRV_SPI_SLAVE 0
387 #define DRV_SPI_RM 0
388 #define DRV_SPI_EBM 1
389 #define DRV_SPI_8BIT 1
390 #define DRV_SPI_16BIT 1
391 #define DRV_SPI_32BIT 0
392 #define DRV_SPI_DMA 0
393 /*** SPI Driver Static Allocation Options ***/
394 #define DRV_SPI_INSTANCES_NUMBER 3
395 #define DRV_SPI_CLIENTS_NUMBER 3
396 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
397 /* SPI Driver Instance 0 Configuration */
398 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
399 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
400 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
401 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
402 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
403 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
404 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
405 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
406 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
407 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
408 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
409 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
410 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
411 #define DRV_SPI_BAUD_RATE_IDX0 1000000
412 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
413 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
414 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
415 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
416 #define DRV_SPI_QUEUE_SIZE_IDX0 10
417 #define DRV_SPI_RESERVED_JOB_IDX0 1
418 /* SPI Driver Instance 1 Configuration */
419 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
420 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
421 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
422 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
423 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
424 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
425 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
426 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
427 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
428 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
429 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
430 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
431 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
432 #define DRV_SPI_BAUD_RATE_IDX1 1000000
433 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
434 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
435 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
436 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
437 #define DRV_SPI_QUEUE_SIZE_IDX1 10
438 #define DRV_SPI_RESERVED_JOB_IDX1 1
439 /* SPI Driver Instance 2 Configuration */
440 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
441 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
442 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
443 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
444 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
445 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
446 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
447 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
448 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
449 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
450 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
451 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
452 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
453 #define DRV_SPI_BAUD_RATE_IDX2 500000
454 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
455 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
456 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
457 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
458 #define DRV_SPI_QUEUE_SIZE_IDX2 10
459 #define DRV_SPI_RESERVED_JOB_IDX2 1
460 /*** Timer Driver Configuration ***/
461 #define DRV_TMR_INTERRUPT_MODE true
462 /*** Timer Driver 0 Configuration ***/
463 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
464 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
465 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
466 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
467 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
468 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
469 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
470 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
471 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
472 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
473 #define DRV_TMR_POWER_STATE_IDX0
474 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
475 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
476 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
477 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
478 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
479 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
480 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
481 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
482 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
483 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
484 #define DRV_TMR_POWER_STATE_IDX1
485 /*** Timer Driver 2 Configuration ***/
486 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
487 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
488 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
489 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
490 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
491 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
492 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
493 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
494 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
495 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
496 #define DRV_TMR_POWER_STATE_IDX2
497 /*** Timer Driver 3 Configuration ***/
498 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
499 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
500 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
501 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
502 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
503 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
504 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
505 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
506 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
507 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
508 #define DRV_TMR_POWER_STATE_IDX3
509 /*** Timer Driver 4 Configuration ***/
510 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
511 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
512 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
513 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
514 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
515 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
516 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
517 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
518 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
519 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
520 #define DRV_TMR_POWER_STATE_IDX4
521  // *****************************************************************************
522 /* USART Driver Configuration Options
523 */
524 #define DRV_USART_INSTANCES_NUMBER 1
525 #define DRV_USART_CLIENTS_NUMBER 1
526 #define DRV_USART_INTERRUPT_MODE false
527 #define DRV_USART_BYTE_MODEL_SUPPORT true
528 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
529 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
530 // *****************************************************************************
531 // *****************************************************************************
532 // Section: Middleware & Other Library Configuration
533 // *****************************************************************************
534 // *****************************************************************************
535 /*** USB Driver Configuration ***/
536 /* Enables Device Support */
537 #define DRV_USBHS_DEVICE_SUPPORT true
538 /* Disable Host Support */
539 #define DRV_USBHS_HOST_SUPPORT false
540 /* Maximum USB driver instances */
541 #define DRV_USBHS_INSTANCES_NUMBER 1
542 /* Interrupt mode enabled */
543 #define DRV_USBHS_INTERRUPT_MODE true
544 /* Number of Endpoints used */
545 #define DRV_USBHS_ENDPOINTS_NUMBER 2
546 /*** USB Device Stack Configuration ***/
547 /* The USB Device Layer will not initialize the USB Driver */
548 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
549 /* Maximum device layer instances */
550 #define USB_DEVICE_INSTANCES_NUMBER 1
551 /* EP0 size in bytes */
552 #define USB_DEVICE_EP0_BUFFER_SIZE 64
553 /* Endpoint Transfer Queue Size combined for Read and write */
554 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
555 // *****************************************************************************
556 // *****************************************************************************
557 // Section: Application Configuration
558 // *****************************************************************************
559 // *****************************************************************************
560 /*** Application Defined Pins ***/
561 /*** Functions for LED1 pin ***/
562 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
563 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
564 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
565 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
566 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
567 /*** Functions for LED2 pin ***/
568 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
569 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
570 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
571 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
572 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
573 /*** Functions for DMP_FIRE_LED pin ***/
574 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
575 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
576 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
577 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
578 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
579 /*** Functions for HVPS_ENB pin ***/
580 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
581 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
582 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
583 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
584 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
585 /*** Functions for RLY_HVPS_OUT pin ***/
586 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
587 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
588 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
589 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
590 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
591 /*** Functions for RLY_WL_SPS_POL pin ***/
592 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
593 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
594 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
595 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
596 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
597 /*** Functions for RLY_LOG pin ***/
598 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
599 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
600 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
601 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
602 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
603 /*** Functions for RLY_DMP_FIRE pin ***/
604 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
605 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
606 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
607 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
608 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
609 /*** Functions for RLY_AUX pin ***/
610 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
611 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
612 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
613 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
614 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
615 /*** Functions for RLY_CCL pin ***/
616 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
617 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
618 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
619 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
620 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
621 /*** Functions for RLY_WL_MON pin ***/
622 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
623 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
624 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
625 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
626 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
627 /*** Functions for RLY_ARMCF pin ***/
628 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
629 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
630 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
631 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
632 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
633 /*** Functions for RLY_ARM pin ***/
634 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
635 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
636 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
637 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
638 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
639 /*** Functions for TPAN1 pin ***/
640 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
641 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
642 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
643 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
644 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
645 /*** Functions for TPAN2 pin ***/
646 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
647 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
648 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
649 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
650 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
651 /*** Functions for FSK_DAC_CS pin ***/
652 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
653 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
654 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
655 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
656 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
657 /*** Functions for RLY_COMM pin ***/
658 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
659 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
660 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
661 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
662 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
663 /*** Functions for FSK_DAC_CLR pin ***/
664 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
665 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
666 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
667 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
668 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
669 /*** Functions for WL_CPS_SW pin ***/
670 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
671 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
672 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
673 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
674 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
675 /*** Functions for HVPS_SW pin ***/
676 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
677 /*** Functions for MAN_SIG pin ***/
678 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
679 /*** Functions for DMP_FIRE_SW pin ***/
680 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
681 /*** Functions for NEG_SW pin ***/
682 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
683 /*** Functions for POS_SW pin ***/
684 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
685 /*** Functions for DRUM1_SW pin ***/
686 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
687 /*** Functions for SAFE_SW pin ***/
688 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
689 /*** Functions for DRUM2_SW pin ***/
690 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
691 /*** Functions for LOG_SW pin ***/
692 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
693 /*** Functions for AUX_SW pin ***/
694 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
695 /*** Functions for ARMCF_SW pin ***/
696 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
697 /*** Functions for ARM_SW pin ***/
698 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
699 /*** Functions for ARMCF_AUTO_SW pin ***/
700 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
701 /*** Functions for FIRE_SW_OFF pin ***/
702 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
703 /*** Functions for FIRE_SW_ON pin ***/
704 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
705 /*** Functions for WL_SPS_POS_DET pin ***/
706 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
707 /*** Functions for WL_SPS_NEG_DET pin ***/
708 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
709 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
710 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
711 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
712 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
713 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
714 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
715 /*** Application Instance 0 Configuration ***/
716 //DOM-IGNORE-BEGIN
717 //DOM-IGNORE-END
718  // _SYSTEM_CONFIG_H
719 /*******************************************************************************
720  End of File
721 */
722 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
723 /* CLOSE_FILE Include File */
724 
725 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
726 /*******************************************************************************
727  System Definitions
728  File Name:
729  system_definitions.h
730  Summary:
731  MPLAB Harmony project system definitions.
732  Description:
733  This file contains the system-wide prototypes and definitions for an MPLAB
734  Harmony project.
735  *******************************************************************************/
736 //DOM-IGNORE-BEGIN
737 /*******************************************************************************
738 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
739 Microchip licenses to you the right to use, modify, copy and distribute
740 Software only when embedded on a Microchip microcontroller or digital signal
741 controller that is integrated into your product or third party product
742 (pursuant to the sublicense terms in the accompanying license agreement).
743 You should refer to the license agreement accompanying this Software for
744 additional information regarding your rights and obligations.
745 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
746 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
747 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
748 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
749 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
750 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
751 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
752 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
753 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
754 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
755  *******************************************************************************/
756 //DOM-IGNORE-END
757 #ifndef _SYS_DEFINITIONS_H
758 #define _SYS_DEFINITIONS_H
759 // *****************************************************************************
760 // *****************************************************************************
761 // Section: Included Files
762 // *****************************************************************************
763 // *****************************************************************************
764 #include <stdint.h>
765 #include <stddef.h>
766 #include <stdbool.h>
767 #include "system/common/sys_common.h"
768 #include "system/common/sys_module.h"
769 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
770 /*******************************************************************************
771  Input Capture Driver Interface Declarations for Static Single Instance Driver
772  Company:
773  Microchip Technology Inc.
774  File Name:
775  help_drv_ic.h
776  Summary:
777  Input Capture driver interface declarations for the static single instance
778  driver.
779  Description:
780  The Input Capture device driver provides a simple interface to manage the
781  Input Capture modules on Microchip microcontrollers. This file defines
782  the interface declarations for the IC driver.
783 
784  Remarks:
785  Static interfaces incorporate the driver instance number within the names
786  of the routines, eliminating the need for an object ID or object handle.
787 
788  Static single-open interfaces also eliminate the need for the open handle.
789 *******************************************************************************/
790 //DOM-IGNORE-BEGIN
791 /*******************************************************************************
792 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
793 Microchip licenses to you the right to use, modify, copy and distribute
794 Software only when embedded on a Microchip microcontroller or digital signal
795 controller that is integrated into your product or third party product
796 (pursuant to the sublicense terms in the accompanying license agreement).
797 You should refer to the license agreement accompanying this Software for
798 additional information regarding your rights and obligations.
799 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
800 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
801 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
802 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
803 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
804 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
805 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
806 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
807 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
808 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
809 *******************************************************************************/
810 //DOM-IGNORE-END
811 #ifndef _DRV_IC_H
812 #define _DRV_IC_H
813 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
814 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
815 /*******************************************************************************
816  Driver Common Header Definitions
817  Company:
818  Microchip Technology Inc.
819  File Name:
820  drv_common.h
821  Summary:
822  This file defines the common macros and definitions used by the driver
823  definition and implementation headers.
824  Description:
825  This file defines the common macros and definitions used by the driver
826  definition and the implementation header.
827  Remarks:
828  The directory in which this file resides should be added to the compiler's
829  search path for header files.
830  *******************************************************************************/
831 //DOM-IGNORE-BEGIN
832 /*******************************************************************************
833 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
834 Microchip licenses to you the right to use, modify, copy and distribute
835 Software only when embedded on a Microchip microcontroller or digital signal
836 controller that is integrated into your product or third party product
837 (pursuant to the sublicense terms in the accompanying license agreement).
838 You should refer to the license agreement accompanying this Software for
839 additional information regarding your rights and obligations.
840 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
841 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
842 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
843 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
844 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
845 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
846 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
847 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
848 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
849 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
850  *******************************************************************************/
851 //DOM-IGNORE-END
852 #ifndef _DRV_COMMON_H
853 #define _DRV_COMMON_H
854 #include <stdint.h>
855 #include <stddef.h>
856 // *****************************************************************************
857 /* Device Driver I/O Intent
858  Summary:
859  Identifies the intended usage of the device when it is opened.
860  Description:
861  This enumeration identifies the intended usage of the device when the
862  caller opens the device. It identifies the desired behavior of the device
863  driver for the following:
864  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
865  block until the operation is finished or do they return immediately and
866  require the caller to call another routine to check the status of the
867  operation)
868  * Support reading and/or writing of data from/to the device
869  * Identify the buffering behavior (sometimes called "double buffering" of
870  the driver. Indicates if the driver should maintain its own read/write
871  buffers and copy data to/from these buffers to/from the caller's buffers.
872  * Identify the DMA behavior of the peripheral
873  Remarks:
874  The buffer allocation method is not identified by this enumeration. Buffers
875  can be allocated statically at build time, dynamically at run-time, or
876  even allocated by the caller and passed to the driver for its own usage if
877  a driver-specific routine is provided for such. This choice is left to
878  the design of the individual driver and is considered part of its
879  interface.
880  These values can be considered "flags". One selection from each of the
881  groups below can be ORed together to create the complete value passed
882  to the driver's open routine.
883 */
884 
885 typedef
886  enum
887  {
888  /* Read */
889  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
890  = 1 << 0 /* DOM-IGNORE-END*/
891  ,
892  /* Write */
893  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
894  = 1 << 1 /* DOM-IGNORE-END*/
895  ,
896  /* Read and Write*/
897  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
898  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
899  ,
900  /* The driver will block and will return when the operation is complete */
901  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
902  = 0 << 2 /* DOM-IGNORE-END*/
903  ,
904  /* The driver will return immediately */
905  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
906  = 1 << 2 /* DOM-IGNORE-END*/
907  ,
908  /* The driver will support only one client at a time */
909  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
910  = 1 << 3 /* DOM-IGNORE-END*/
911  ,
912  /* The driver will support multiple clients at a time */
913  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
914  = 0 << 3 /* DOM-IGNORE-END*/
915  } DRV_IO_INTENT ;
916 // *****************************************************************************
917 /* Driver Client Status
918  Summary:
919  Identifies the current status/state of a client's connection to a driver.
920  Description:
921  This enumeration identifies the current status/state of a client's link to
922  a driver.
923  Remarks:
924  The enumeration used as the return type for the client-level status routines
925  defined by each device driver or system module (for example,
926  DRV_USART_ClientStatus) must be based on the values in this enumeration.
927 */
928 
929 typedef
930  enum
931  {
932  /* Indicates that a driver-specific error has occurred. */
934  /* An unspecified error has occurred.*/
936  /* The driver is closed, no operations for this client are ongoing,
937  and/or the given handle is invalid. */
939  /* The driver is currently busy and cannot start additional operations. */
941  /* The module is running and ready for additional operations */
943  /* Indicates that the module is in a driver-specific ready/run state. */
946 // *****************************************************************************
947 /* Device Driver Blocking Status Macro
948  Summary:
949  Returns if the I/O intent provided is blocking
950  Description:
951  This macro returns if the I/O intent provided is blocking.
952  Remarks:
953  None.
954 */
955 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
956 // *****************************************************************************
957 /* Device Driver Non Blocking Status Macro
958  Summary:
959  Returns if the I/O intent provided is non-blocking.
960  Description:
961  This macro returns if the I/ intent provided is non-blocking.
962  Remarks:
963  None.
964 */
965 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
966 // *****************************************************************************
967 /* Device Driver Exclusive Status Macro
968  Summary:
969  Returns if the I/O intent provided is non-blocking.
970  Description:
971  This macro returns if the I/O intent provided is non-blocking.
972  Remarks:
973  None.
974 */
975 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
976 // *****************************************************************************
977 /* Device Driver IO Buffer Identifier
978  Summary:
979  Identifies to which buffer a device operation will apply.
980  Description:
981  This enumeration identifies to which buffer (read, write, both, or neither)
982  a device operation will apply. This is used for "flush" (or similar)
983  operations.
984 */
985 
986 typedef
987  enum
988  {
989  // Operation does not apply to any buffer
991  // Operation applies to read buffer
993  // Operation applies to write buffer
995  // Operation applies to both read and write buffers
998 // *****************************************************************************
999 /* Device Handle
1000  Summary:
1001  Handle to an opened device driver.
1002  Description:
1003  This handle identifies the open instance of a device driver. It must be
1004  passed to all other driver routines (except the initialization, deinitialization,
1005  or power routines) to identify the caller.
1006  Remarks:
1007  Every application or module that wants to use a driver must first call
1008  the driver's open routine. This is the only routine that is absolutely
1009  required for every driver.
1010  If a driver is unable to allow an additional module to use it, it must then
1011  return the special value DRV_HANDLE_INVALID. Callers should check the
1012  handle returned for this value to ensure this value was not returned before
1013  attempting to call any other driver routines using the handle.
1014 */
1015 
1016 typedef
1017 uintptr_t
1019 // *****************************************************************************
1020 /* Invalid Device Handle
1021  Summary:
1022  Invalid device handle.
1023  Description:
1024  If a driver is unable to allow an additional module to use it, it must then
1025  return the special value DRV_HANDLE_INVALID. Callers should check the
1026  handle returned for this value to ensure this value was not returned before
1027  attempting to call any other driver routines using the handle.
1028  Remarks:
1029  None.
1030 */
1031 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1032 // *****************************************************************************
1033 /* Not supported configuration
1034  Summary:
1035  Not supported configuration.
1036  Description:
1037  If the configuration option is not supported on an instance of the
1038  peripheral, use this macro to equate to that configuration. This option
1039  should be listed as a possible value in the description of that
1040  configuration option.
1041 */
1042 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1043 // *****************************************************************************
1044 /* Unsupported Attribute Abstraction
1045  Summary:
1046  Abstracts the use of the unsupported attribute defined by the compiler.
1047  Description:
1048  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1049  compilation of the drivers for all different variants.
1050  Example:
1051  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1052  This function will not generate a compiler error if the interface is not
1053  defined for the selected device.
1054  Remarks:
1055  None.
1056 */
1057 #define _PLIB_UNSUPPORTED
1058  //_DRV_COMMON_H
1059 /*******************************************************************************
1060  End of File
1061 */
1062 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1063 /* CLOSE_FILE Include File */
1064 
1065 #include "system/common/sys_module.h"
1066 // *****************************************************************************
1067 /* IC Driver Module Index Numbers
1068  Summary:
1069  IC driver index definitions.
1070  Description:
1071  These constants provide IC Driver index definitions.
1072  Remarks:
1073  These constants should be used in place of hard-coded numeric literals.
1074  These values should be passed into the DRV_IC_Initialize and
1075  DRV_IC_Open routines to identify the driver instance in use.
1076 */
1077 #define DRV_IC_INDEX_0 0
1078 #define DRV_IC_INDEX_1 1
1079 #define DRV_IC_INDEX_2 2
1080 #define DRV_IC_INDEX_3 3
1081 #define DRV_IC_INDEX_4 4
1082 #define DRV_IC_INDEX_5 5
1083 #define DRV_IC_INDEX_6 6
1084 #define DRV_IC_INDEX_7 7
1085 #define DRV_IC_INDEX_8 8
1086 #define DRV_IC_INDEX_9 9
1087 #define DRV_IC_INDEX_10 10
1088 #define DRV_IC_INDEX_11 11
1089 #define DRV_IC_INDEX_12 12
1090 #define DRV_IC_INDEX_13 13
1091 #define DRV_IC_INDEX_14 14
1092 #define DRV_IC_INDEX_15 15
1093 // *****************************************************************************
1094 // *****************************************************************************
1095 // Section: Interface Headers for the static driver
1096 // *****************************************************************************
1097 // *****************************************************************************
1098 // *****************************************************************************
1099 /* Function:
1100  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1101  const SYS_MODULE_INIT * const init);
1102  Summary:
1103  Initializes the Input Capture instance for the specified driver index.
1104  <p><b>Implementation:</b> Static</p>
1105  Description:
1106  This routine initializes the Input Capture driver instance for the specified
1107  driver instance, making it ready for clients to use it. The initialization
1108  routine is specified by the MHC parameters. The driver instance index is
1109  independent of the Input Capture module ID. For example, driver instance 0
1110  can be assigned to Input Capture 2.
1111  Precondition:
1112  None.
1113  Parameters:
1114  None.
1115  Returns:
1116  None.
1117  Remarks:
1118  This routine must be called before any other Input Capture routine is called.
1119  This routine should only be called once during system initialization.
1120 */
1121 
1122 SYS_MODULE_OBJ
1124  const SYS_MODULE_INDEX index ,
1125  const SYS_MODULE_INIT * const init ) ;
1126 // *****************************************************************************
1127 /* Function:
1128 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1129  Summary:
1130  Opens the Input Capture instance for the specified driver index.
1131  <p><b>Implementation:</b> Static</p>
1132  Description:
1133  This routine starts the Input Capture driver for the specified driver
1134  index, starting an input capture.
1135  Precondition:
1136  DRV_IC_Initialize has been called.
1137  Parameters:
1138  None.
1139  Returns:
1140  None.
1141  Remarks:
1142  None.
1143 */
1144 
1145 DRV_HANDLE
1146  DRV_IC_Open (
1147  const SYS_MODULE_INDEX drvIndex ,
1148  const DRV_IO_INTENT intent ) ;
1149 // *****************************************************************************
1150 /* Function:
1151  void DRV_IC_Close(DRV_HANDLE handle)
1152  Summary:
1153  Closes the Input Capture instance for the specified driver index.
1154  <p><b>Implementation:</b> Static</p>
1155  Description:
1156  This routine stops the Input Capture driver for the specified driver
1157  index, stopping an input capture.
1158  Precondition:
1159  DRV_IC_Initialize has been called.
1160  Parameters:
1161  None.
1162  Returns:
1163  None.
1164  Remarks:
1165  None.
1166 */
1167 
1168 void
1169  DRV_IC_Close (
1170  DRV_HANDLE handle ) ;
1171 // *****************************************************************************
1172 /* Function:
1173 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1174  Summary:
1175  Starts the Input Capture instance for the specified driver index.
1176  <p><b>Implementation:</b> Static</p>
1177  Description:
1178  This routine starts the Input Capture driver for the specified driver
1179  index, starting an input capture.
1180  Precondition:
1181  DRV_IC_Initialize has been called.
1182  Parameters:
1183  None.
1184  Returns:
1185  None.
1186  Remarks:
1187  None.
1188 */
1189 
1190 DRV_HANDLE
1191  DRV_IC_Start (
1192  const SYS_MODULE_INDEX drvIndex ,
1193  const DRV_IO_INTENT intent ) ;
1194 // *****************************************************************************
1195 /* Function:
1196  void DRV_IC_Stop(DRV_HANDLE handle)
1197  Summary:
1198  Stops the Input Capture instance for the specified driver index.
1199  <p><b>Implementation:</b> Static</p>
1200  Description:
1201  This routine stops the Input Capture driver for the specified driver
1202  index, stopping an input capture.
1203  Precondition:
1204  DRV_IC_Initialize has been called.
1205  Parameters:
1206  None.
1207  Returns:
1208  None.
1209  Remarks:
1210  None.
1211 */
1212 
1213 void
1214  DRV_IC_Stop (
1215  DRV_HANDLE handle ) ;
1216 // *****************************************************************************
1217 /* Function:
1218  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1219  Summary:
1220  Reads the 32-bit Input Capture for the specified driver index.
1221  <p><b>Implementation:</b> Static</p>
1222  Description:
1223  This routine reads the 32-bit data for the specified driver index
1224  Precondition:
1225  DRV_IC_Initialize has been called.
1226  Parameters:
1227  None.
1228  Returns:
1229  uint32_t value of the data read from the Input Capture.
1230  Remarks:
1231  None.
1232 */
1233 
1234 uint32_t
1236  DRV_HANDLE handle ) ;
1237 // *****************************************************************************
1238 /* Function:
1239  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1240  Summary:
1241  Reads the 16-bit Input Capture for the specified driver index.
1242  <p><b>Implementation:</b> Static</p>
1243  Description:
1244  This routine reads the 16-bit data for the specified driver index.
1245  Precondition:
1246  DRV_IC_Initialize has been called.
1247  Parameters:
1248  None.
1249  Returns:
1250  uint16_t value of the data read from the Input Capture.
1251  Remarks:
1252  None.
1253 */
1254 
1255 uint16_t
1257  DRV_HANDLE handle ) ;
1258 // *****************************************************************************
1259 /* Function:
1260  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1261  Summary:
1262  Returns the Input Capture instance buffer empty status for the specified driver
1263  index.
1264  <p><b>Implementation:</b> Static</p>
1265  Description:
1266  Returns the Input Capture instance buffer empty status for the specified driver
1267  index. The function should be called to determine whether or not the IC buffer
1268  has data.
1269  Precondition:
1270  DRV_IC_Initialize has been called.
1271  Parameters:
1272  None.
1273  Returns:
1274  Boolean
1275  - 1 - Buffer is empty
1276  - 0 - Buffer is not empty
1277  Remarks:
1278  None.
1279 */
1280 
1281 bool
1283  DRV_HANDLE handle ) ;
1284 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1285 /*******************************************************************************
1286  IC Driver Interface Declarations for Static Single Instance Driver
1287  Company:
1288  Microchip Technology Inc.
1289  File Name:
1290  drv_ic_static.h
1291  Summary:
1292  IC driver interface declarations for the static single instance driver.
1293  Description:
1294  The IC device driver provides a simple interface to manage the IC
1295  modules on Microchip microcontrollers. This file defines the interface
1296  Declarations for the IC driver.
1297 
1298  Remarks:
1299  Static interfaces incorporate the driver instance number within the names
1300  of the routines, eliminating the need for an object ID or object handle.
1301 
1302  Static single-open interfaces also eliminate the need for the open handle.
1303 *******************************************************************************/
1304 //DOM-IGNORE-BEGIN
1305 /*******************************************************************************
1306 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1307 Microchip licenses to you the right to use, modify, copy and distribute
1308 Software only when embedded on a Microchip microcontroller or digital signal
1309 controller that is integrated into your product or third party product
1310 (pursuant to the sublicense terms in the accompanying license agreement).
1311 You should refer to the license agreement accompanying this Software for
1312 additional information regarding your rights and obligations.
1313 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1314 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1315 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1316 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1317 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1318 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1319 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1320 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1321 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1322 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1323 *******************************************************************************/
1324 //DOM-IGNORE-END
1325 #ifndef _DRV_IC_STATIC_H
1326 #define _DRV_IC_STATIC_H
1327 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1328 #define DRV_IC_Close( handle )
1329 // *****************************************************************************
1330 // *****************************************************************************
1331 // Section: Interface Headers for Instance 0 for the static driver
1332 // *****************************************************************************
1333 // *****************************************************************************
1334 
1335 void
1336  DRV_IC0_Initialize ( void ) ;
1337 
1338 void
1339  DRV_IC0_Start ( void ) ;
1340 
1341 void
1342  DRV_IC0_Stop ( void ) ;
1343 
1344 uint32_t
1345  DRV_IC0_Capture32BitDataRead ( void ) ;
1346 
1347 uint16_t
1348  DRV_IC0_Capture16BitDataRead ( void ) ;
1349 
1350 bool
1351  DRV_IC0_BufferIsEmpty ( void ) ;
1352  // #ifndef _DRV_IC_STATIC_H
1353 /*******************************************************************************
1354  End of File
1355 */
1356 
1357 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1358 /* CLOSE_FILE Include File */
1359 
1360  // #ifndef _DRV_IC_H
1361 /*******************************************************************************
1362  End of File
1363 */
1364 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1365 /* CLOSE_FILE Include File */
1366 
1367 #include "system/devcon/sys_devcon.h"
1368 #include "system/clk/sys_clk.h"
1369 #include "system/int/sys_int.h"
1370 #include "system/tmr/sys_tmr.h"
1371 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1372 /*******************************************************************************
1373  ADC Driver Interface Declarations for Static Single Instance Driver
1374  Company:
1375  Microchip Technology Inc.
1376  File Name:
1377  drv_adc_static.h
1378  Summary:
1379  ADC driver interface declarations for the static single instance driver.
1380  Description:
1381  The ADC device driver provides a simple interface to manage the ADC
1382  modules on Microchip microcontrollers. This file defines the interface
1383  Declarations for the ADC driver.
1384 
1385  Remarks:
1386  Static interfaces incorporate the driver instance number within the names
1387  of the routines, eliminating the need for an object ID or object handle.
1388 
1389  Static single-open interfaces also eliminate the need for the open handle.
1390 *******************************************************************************/
1391 //DOM-IGNORE-BEGIN
1392 /*******************************************************************************
1393 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1394 Microchip licenses to you the right to use, modify, copy and distribute
1395 Software only when embedded on a Microchip microcontroller or digital signal
1396 controller that is integrated into your product or third party product
1397 (pursuant to the sublicense terms in the accompanying license agreement).
1398 You should refer to the license agreement accompanying this Software for
1399 additional information regarding your rights and obligations.
1400 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1401 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1402 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1403 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1404 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1405 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1406 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1407 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1408 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1409 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1410 *******************************************************************************/
1411 //DOM-IGNORE-END
1412 #ifndef _DRV_ADC_STATIC_H
1413 #define _DRV_ADC_STATIC_H
1414 #include <stdbool.h>
1415 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1416 #include "peripheral/adchs/plib_adchs.h"
1417 #include "peripheral/int/plib_int.h"
1418 
1419 typedef
1420  enum
1421  {
1422  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1424  } DRV_ADC_MODULE_ID ;
1425 // *****************************************************************************
1426 // *****************************************************************************
1427 // Section: Interface Headers for ADC Static Driver
1428 // *****************************************************************************
1429 // *****************************************************************************
1430 
1431 void
1432  DRV_ADC_Initialize ( void ) ;
1433 
1434 inline void
1435  DRV_ADC_DeInitialize ( void ) ;
1436 
1437 inline void
1438  DRV_ADC0_Open ( void ) ;
1439 
1440 inline void
1441  DRV_ADC0_Close ( void ) ;
1442 
1443 inline void
1444  DRV_ADC1_Open ( void ) ;
1445 
1446 inline void
1447  DRV_ADC1_Close ( void ) ;
1448 
1449 inline void
1450  DRV_ADC_Start ( void ) ;
1451 
1452 inline void
1453  DRV_ADC_Stop ( void ) ;
1454 
1455 uint32_t
1457  uint8_t bufIndex ) ;
1458 
1459 bool
1461  uint8_t bufIndex ) ;
1462  // #ifndef _DRV_ADC_STATIC_H
1463 /*******************************************************************************
1464  End of File
1465 */
1466 
1467 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1468 /* CLOSE_FILE Include File */
1469 
1470 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1471 /*******************************************************************************
1472  Timer Driver Interface Declarations for Static Single Instance Driver
1473  Company:
1474  Microchip Technology Inc.
1475  File Name:
1476  drv_tmr_static.h
1477  Summary:
1478  Timer driver interface declarations for the static single instance driver.
1479  Description:
1480  The Timer device driver provides a simple interface to manage the Timer
1481  modules on Microchip microcontrollers. This file defines the interface
1482  Declarations for the TMR driver.
1483 
1484  Remarks:
1485  Static interfaces incorporate the driver instance number within the names
1486  of the routines, eliminating the need for an object ID or object handle.
1487 
1488  Static single-open interfaces also eliminate the need for the open handle.
1489 *******************************************************************************/
1490 //DOM-IGNORE-BEGIN
1491 /*******************************************************************************
1492 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1493 Microchip licenses to you the right to use, modify, copy and distribute
1494 Software only when embedded on a Microchip microcontroller or digital signal
1495 controller that is integrated into your product or third party product
1496 (pursuant to the sublicense terms in the accompanying license agreement).
1497 You should refer to the license agreement accompanying this Software for
1498 additional information regarding your rights and obligations.
1499 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1500 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1501 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1502 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1503 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1504 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1505 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1506 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1507 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1508 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1509 *******************************************************************************/
1510 //DOM-IGNORE-END
1511 #ifndef _DRV_TMR_STATIC_H
1512 #define _DRV_TMR_STATIC_H
1513 // *****************************************************************************
1514 // *****************************************************************************
1515 // Section: Include Headers
1516 // *****************************************************************************
1517 // *****************************************************************************
1518 #include <stdint.h>
1519 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1520 /*******************************************************************************
1521  Timer Device Driver Interface Definition
1522  Company:
1523  Microchip Technology Inc.
1524  File Name:
1525  drv_tmr.h
1526  Summary:
1527  Timer device driver interface header file.
1528  Description:
1529  This header file contains the function prototypes and definitions of the
1530  data types and constants that make up the interface to the Timer device
1531  driver.
1532 *******************************************************************************/
1533 //DOM-IGNORE-BEGIN
1534 /*******************************************************************************
1535 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1536 Microchip licenses to you the right to use, modify, copy and distribute
1537 Software only when embedded on a Microchip microcontroller or digital signal
1538 controller that is integrated into your product or third party product
1539 (pursuant to the sublicense terms in the accompanying license agreement).
1540 You should refer to the license agreement accompanying this Software for
1541 additional information regarding your rights and obligations.
1542 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1543 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1544 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1545 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1546 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1547 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1548 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1549 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1550 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1551 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1552 *******************************************************************************/
1553 //DOM-IGNORE-END
1554 #ifndef _DRV_TMR_H
1555 #define _DRV_TMR_H
1556 // *****************************************************************************
1557 // *****************************************************************************
1558 // Section: File includes
1559 // *****************************************************************************
1560 // *****************************************************************************
1561 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1562 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1563 #include "peripheral/tmr/plib_tmr.h"
1564 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1565 /*******************************************************************************
1566  Timer Device Driver Interface Definition
1567  Company:
1568  Microchip Technology Inc.
1569  File Name:
1570  tmr_definitions_pic32m.h
1571  Summary:
1572  Timer device driver definitions header file.
1573  Description:
1574  This header file contains the definitions of the
1575  data types and constants that make up the interface to the Timer device
1576  driver.
1577 *******************************************************************************/
1578 //DOM-IGNORE-BEGIN
1579 /*******************************************************************************
1580 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1581 Microchip licenses to you the right to use, modify, copy and distribute
1582 Software only when embedded on a Microchip microcontroller or digital signal
1583 controller that is integrated into your product or third party product
1584 (pursuant to the sublicense terms in the accompanying license agreement).
1585 You should refer to the license agreement accompanying this Software for
1586 additional information regarding your rights and obligations.
1587 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1588 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1589 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1590 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1591 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1592 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1593 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1594 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1595 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1596 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1597 *******************************************************************************/
1598 //DOM-IGNORE-END
1599 #ifndef _TMR_DEFINITIONS_PIC32M_H
1600 #define _TMR_DEFINITIONS_PIC32M_H
1601 // DOM-IGNORE-BEGIN
1602 // DOM-IGNORE-END
1603 
1604 typedef
1605  enum
1606  {
1607  /* Clock input to the timer module is internal(Peripheral Clock) */
1609  /*DOM-IGNORE-BEGIN*/
1610  = 0x00 /*DOM-IGNORE-END*/
1611  ,
1612  /* Clock input to the timer module is from T1CK pin (external)
1613  with clock synchronization enabled */
1615  /*DOM-IGNORE-BEGIN*/
1616  = 0x01 /*DOM-IGNORE-END*/
1617  ,
1618  /* Clock input to the timer module is from T1CK pin (external)
1619  with clock synchronization disabled */
1621  /*DOM-IGNORE-BEGIN*/
1622  = 0x11 /*DOM-IGNORE-END*/
1623  ,
1624  /* Clock input to the timer module is from secondary oscillator (external)
1625  with clock synchronization enabled */
1627  /*DOM-IGNORE-BEGIN*/
1628  = 0x02 /*DOM-IGNORE-END*/
1629  ,
1630  /* Clock input to the timer module is from secondary oscillator (external)
1631  with clock synchronization disabled */
1633  /*DOM-IGNORE-BEGIN*/
1634  = 0x12 /*DOM-IGNORE-END*/
1635  ,
1636  /* Clock input to the timer module is from LPRC
1637  with clock synchronization enabled */
1639  /*DOM-IGNORE-BEGIN*/
1640  = 0x03 /*DOM-IGNORE-END*/
1641  ,
1642  /* Clock input to the timer module is from LPRC
1643  with clock synchronization disabled */
1645  /*DOM-IGNORE-BEGIN*/
1646  = 0x13 /*DOM-IGNORE-END*/
1648 //DOM-IGNORE-BEGIN
1649 //DOM-IGNORE-END
1650  // #ifndef _DRV_TMR_H
1651 /*******************************************************************************
1652  End of File
1653 */
1654 
1655 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1656 /* CLOSE_FILE Include File */
1657 
1658 #include "system/int/sys_int.h" // System Interrupt Definitions
1659 #include "system/clk/sys_clk.h"
1660 // DOM-IGNORE-BEGIN
1661 // DOM-IGNORE-END
1662 // *****************************************************************************
1663 // *****************************************************************************
1664 // Section: TMR Driver Data Types
1665 // *****************************************************************************
1666 // *****************************************************************************
1667 // *****************************************************************************
1668 /* Timer Driver Module Index Numbers
1669  Summary:
1670  Timer driver index definitions
1671  Description:
1672  These constants provide Timer driver index definitions.
1673  Remarks:
1674  These constants should be used in place of hard-coded numeric literals.
1675  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1676  functions to identify the driver instance in use.
1677 */
1678 #define DRV_TMR_INDEX_0 0
1679 #define DRV_TMR_INDEX_1 1
1680 #define DRV_TMR_INDEX_2 2
1681 #define DRV_TMR_INDEX_3 3
1682 #define DRV_TMR_INDEX_4 4
1683 #define DRV_TMR_INDEX_5 5
1684 #define DRV_TMR_INDEX_6 6
1685 #define DRV_TMR_INDEX_7 7
1686 #define DRV_TMR_INDEX_8 8
1687 #define DRV_TMR_INDEX_9 9
1688 #define DRV_TMR_INDEX_10 10
1689 #define DRV_TMR_INDEX_11 11
1690 // *****************************************************************************
1691 /* Timer Driver Module Index Count
1692  Summary:
1693  Number of valid Timer driver indices.
1694  Description:
1695  This constant identifies Timer driver index definitions.
1696  Remarks:
1697  This constant should be used in place of hard-coded numeric literals.
1698  This value is device-specific.
1699 */
1700 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1701 // *****************************************************************************
1702 /* Timer Driver Client Status
1703  Summary:
1704  Identifies the client-specific status of the Timer driver
1705  Description:
1706  This enumeration identifies the client-specific status of the Timer driver.
1707  Remarks:
1708  None.
1709 */
1710 
1711 typedef
1712  enum
1713  {
1714  /* Driver is invalid (or unopened) state */
1716  /*DOM-IGNORE-BEGIN*/
1717  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1718  ,
1719  /* An operation is currently in progress */
1721  /*DOM-IGNORE-BEGIN*/
1722  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1723  ,
1724  /* Ready, no operations running */
1726  /*DOM-IGNORE-BEGIN*/
1727  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1728  ,
1729  /* Timer started and running, processing transactions */
1731  /*DOM-IGNORE-BEGIN*/
1732  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1734 // *****************************************************************************
1735 /* Timer Driver Clock sources
1736  Summary:
1737  Lists the clock sources available for timer driver.
1738  Description:
1739  This enumeration lists all the available clock sources for the timer
1740  hardware.
1741  Remarks:
1742  Not all modes are available on all devices.
1743  'Synchronization' may not be applicable for all the instances of the timer.
1744  The driver discards the Synchronization mode selected if it is not
1745  applicable for the selected hardware.
1746 */
1747 // *****************************************************************************
1748 /* Timer Driver Operation mode
1749  Summary:
1750  Lists the operation modes available for timer driver.
1751  Description:
1752  This enumeration lists all the available operation modes that are valid for
1753  the timer hardware.
1754  Remarks:
1755  Not all modes are available on all devices.
1756 */
1757 
1758 typedef
1759  enum
1760  {
1761  /* The timer module operating mode none/invalid */
1763  /* The timer module operates in 16 bit mode */
1765  /* The timer module operates in 32 bit mode */
1766  /* This will combine two 16 bit timer modules */
1769 // *****************************************************************************
1770 /* Timer Driver divider operating specification
1771  Summary:
1772  This data structure specifies the divider values that can be obtained by the
1773  timer module.
1774  Description:
1775  This data structure specifies the divider values that can be obtained by the
1776  timer hardware.
1777  Remarks:
1778  None.
1779 */
1780 
1781 typedef
1782  struct
1783  {
1784  /* The minimum divider value that the timer module can obtain */
1785  uint32_t dividerMin ;
1786  /* The maximum divider value that the timer module can obtain */
1787  uint32_t dividerMax ;
1788  /* The divider step value, between 2 divider values */
1789  /* Should be 1 for most timers */
1790  uint32_t dividerStep ;
1792 // *****************************************************************************
1793 /* Timer Driver Initialize Data
1794  Summary:
1795  Defines the Timer driver initialization data.
1796  Description:
1797  This data type defines data required to initialize the Timer driver.
1798  Remarks:
1799  Not all initialization features are available on all devices.
1800 */
1801 
1802 typedef
1803  struct
1804  {
1805  /* System module initialization. */
1806  SYS_MODULE_INIT moduleInit ;
1807  /* Identifies timer hardware module (PLIB-level) ID */
1808  TMR_MODULE_ID tmrId ;
1809  /* Clock Source select. */
1810  DRV_TMR_CLK_SOURCES clockSource ;
1811  /* Prescaler Selection from the processor enumeration */
1812  TMR_PRESCALE prescale ;
1813  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1814  is selected the interrupt will be generated by the 2nd timer of the pair,
1815  the odd numbered one. */
1816  INT_SOURCE interruptSource ;
1817  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1818  timer modules to form a 32 bit one. This is usually only necessary for
1819  very long delays. */
1820  DRV_TMR_OPERATION_MODE mode ;
1821  /* Asynchronous write enable configuration. If true the asynchronous write
1822  is enabled. For timers that do not support this feature the value is
1823  ignored */
1824  bool asyncWriteEnable ;
1825  } DRV_TMR_INIT ;
1826 // *****************************************************************************
1827 /* Timer Driver Callback Function Pointer
1828  Summary:
1829  Pointer to a Timer driver callback function data type.
1830  Description:
1831  This data type defines a pointer to a Timer driver callback function.
1832  Remarks:
1833  Useful only when timer alarm callback support is enabled by defining the
1834  DRV_TMR_ALARM_ENABLE configuration option.
1835 */
1836 
1837 typedef
1838 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1839 uint32_t alarmCount ) ;
1840 // *****************************************************************************
1841 // *****************************************************************************
1842 // Section: Timer Driver Module Interface Functions
1843 // *****************************************************************************
1844 // *****************************************************************************
1845 // *****************************************************************************
1846 /* Function:
1847  SYS_MODULE_OBJ DRV_TMR_Initialize
1848  (
1849  const SYS_MODULE_INDEX drvIndex,
1850  const SYS_MODULE_INIT * const init
1851  )
1852  Summary:
1853  Initializes the Timer driver.
1854  <p><b>Implementation:</b> Static/Dynamic</p>
1855  Description:
1856  This function initializes the Timer driver, making it ready for clients to
1857  open and use it.
1858  Precondition:
1859  None.
1860  Parameters:
1861  drvIndex - Index for the driver instance to be initialized
1862  init - Pointer to a data structure containing any data necessary
1863  to initialize the driver.
1864  Returns:
1865  If successful, returns a valid handle to a driver object. Otherwise, it
1866  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1867  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1868  Example:
1869  <code>
1870  DRV_TMR_INIT init;
1871  SYS_MODULE_OBJ objectHandle;
1872  // Populate the timer initialization structure
1873  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1874  init.tmrId = TMR_ID_2;
1875  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1876  init.prescale = TMR_PRESCALE_VALUE_256;
1877  init.interruptSource = INT_SOURCE_TIMER_2;
1878  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1879  init.asyncWriteEnable = false;
1880  // Do something
1881  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1882  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1883  {
1884  // Handle error
1885  }
1886  </code>
1887  Remarks:
1888  This function must be called before any other Timer driver function is
1889  called.
1890  This function should only be called once during system initialization unless
1891  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1892  This function will NEVER block for hardware access. The system must use
1893  DRV_TMR_Status to find out when the driver is in the ready state.
1894  Build configuration options may be used to statically override options in
1895  the "init" structure and will take precedence over initialization data
1896  passed using this function.
1897 */
1898 
1899 SYS_MODULE_OBJ
1901  const SYS_MODULE_INDEX drvIndex ,
1902  const SYS_MODULE_INIT * const init ) ;
1903 // *****************************************************************************
1904 /* Function:
1905  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1906  Summary:
1907  Deinitializes the specified instance of the Timer driver.
1908  <p><b>Implementation:</b> Dynamic</p>
1909  Description:
1910  Deinitializes the specified instance of the Timer driver, disabling
1911  its operation (and any hardware). All internal data is invalidated.
1912  Precondition:
1913  The DRV_TMR_Initialize function must have been called before calling this
1914  function and a valid SYS_MODULE_OBJ must have been returned.
1915  Parameters:
1916  object - Driver object handle, returned from DRV_TMR_Initialize
1917  Returns:
1918  None.
1919  Example:
1920  <code>
1921  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
1922  SYS_STATUS tmrStatus;
1923  DRV_TMR_Deinitialize ( tmrObject );
1924  tmrStatus = DRV_TMR_Status ( tmrObject );
1925  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
1926  {
1927  // Check again later if you need to know
1928  // when the driver is deinitialized.
1929  }
1930  </code>
1931  Remarks:
1932  Once the Initialize operation has been called, the Deinitialize operation
1933  must be called before the Initialize operation can be called again.
1934  This function will NEVER block waiting for hardware. If the operation
1935  requires time to allow the hardware to complete, this will be reported by
1936  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
1937  out when the module is in the ready state.
1938 */
1939 
1940 void
1942  SYS_MODULE_OBJ object ) ;
1943 // *****************************************************************************
1944 /* Function:
1945  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
1946  Summary:
1947  Provides the current status of the Timer driver.
1948  <p><b>Implementation:</b> Dynamic</p>
1949  Description:
1950  This function provides the current status of the Timer driver.
1951  Precondition:
1952  The DRV_TMR_Initialize function must have been called before calling this
1953  function.
1954  Parameters:
1955  object - Driver object handle, returned from DRV_TMR_Initialize
1956  Returns:
1957  SYS_STATUS_READY - Indicates that the driver is initialized and ready
1958  for operation
1959  Note: Any value greater than SYS_STATUS_READY is
1960  also a normal running state in which the driver
1961  is ready to accept new operations.
1962  SYS_STATUS_ERROR - Indicates that the driver is in an error state
1963  Note: Any value less than SYS_STATUS_ERROR is
1964  also an error state.
1965  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
1966  Note: This value is less than SYS_STATUS_ERROR.
1967  Example:
1968  <code>
1969  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1970  SYS_STATUS tmrStatus;
1971  tmrStatus = DRV_TMR_Status ( object );
1972  else if ( SYS_STATUS_ERROR >= tmrStatus )
1973  {
1974  // Handle error
1975  }
1976  </code>
1977  Remarks:
1978  The this operation can be used to determine when any of the driver's module
1979  level operations has completed.
1980  Once the status operation returns SYS_STATUS_READY, the driver is ready for
1981  operation.
1982  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
1983  also an error state.
1984  This function will NEVER block waiting for hardware.
1985 */
1986 
1987 SYS_STATUS
1988  DRV_TMR_Status (
1989  SYS_MODULE_OBJ object ) ;
1990 // *****************************************************************************
1991 /* Function:
1992  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
1993  Summary:
1994  Maintains the driver's state machine.
1995  <p><b>Implementation:</b> Dynamic</p>
1996  Description:
1997  This function is used to maintain the driver's internal state machine and
1998  processes the timer events..
1999  Precondition:
2000  The DRV_TMR_Initialize function must have been called for the specified Timer
2001  driver instance.
2002  Parameters:
2003  object - Object handle for the specified driver instance (returned from
2004  DRV_TMR_Initialize)
2005  Returns:
2006  None
2007  Example:
2008  <code>
2009  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2010  while (true)
2011  {
2012  DRV_TMR_Tasks ( object );
2013  // Do other tasks
2014  }
2015  </code>
2016  Remarks:
2017  This function is normally not called directly by an application. It is
2018  called by the system's Tasks routine (SYS_Tasks)
2019 */
2020 
2021 void
2022  DRV_TMR_Tasks (
2023  SYS_MODULE_OBJ object ) ;
2024 // *****************************************************************************
2025 // *****************************************************************************
2026 // Section: TMR Driver Client Functions
2027 // *****************************************************************************
2028 // *****************************************************************************
2029 // *****************************************************************************
2030 /* Function:
2031  DRV_HANDLE DRV_TMR_Open
2032  (
2033  const SYS_MODULE_INDEX index,
2034  const DRV_IO_INTENT intent
2035  )
2036  Summary:
2037  Opens the specified Timer driver instance and returns a handle to it.
2038  <p><b>Implementation:</b> Dynamic</p>
2039  Description:
2040  This function opens the specified Timer driver instance and provides a
2041  handle that must be provided to all other client-level operations to
2042  identify the caller and the instance of the driver. Timer driver does not
2043  support multiple clients. If two tasks want to use the timer, one should
2044  wait until the other one gets closed.
2045  Precondition:
2046  The DRV_TMR_Initialize function must have been called before calling this
2047  function.
2048  Parameters:
2049  index - Identifier for the object instance to be opened
2050  intent - Zero or more of the values from the enumeration
2051  DRV_IO_INTENT ORed together to indicate the intended use
2052  of the driver
2053  Returns:
2054  If successful, the function returns a valid open instance handle (a number
2055  identifying both the caller and the module instance).
2056  If an error occurs, the return value is DRV_HANDLE_INVALID.
2057  Example:
2058  <code>
2059  DRV_HANDLE handle;
2060  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2061  if ( DRV_HANDLE_INVALID == handle )
2062  {
2063  // Unable to open the driver
2064  }
2065  </code>
2066  Remarks:
2067  The handle returned is valid until the DRV_TMR_Close function is called.
2068  This function will NEVER block waiting for hardware.
2069  If the requested intent flags are not supported, the function will return
2070  DRV_HANDLE_INVALID.
2071  The Timer driver does not support DRV_IO_INTENT_SHARED.
2072  Only exclusive access is supported for now.
2073 */
2074 
2075 DRV_HANDLE
2076  DRV_TMR_Open (
2077  const SYS_MODULE_INDEX index ,
2078  const DRV_IO_INTENT intent ) ;
2079 // *****************************************************************************
2080 /* Function:
2081  void DRV_TMR_Close ( DRV_HANDLE handle )
2082  Summary:
2083  Closes an opened instance of the Timer driver.
2084  <p><b>Implementation:</b> Dynamic</p>
2085  Description:
2086  This function closes an opened instance of the Timer driver, invalidating
2087  the handle.
2088  Precondition:
2089  The DRV_TMR_Initialize function must have been called for the specified
2090  Timer driver instance.
2091  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2092  Parameters:
2093  handle - A valid open-instance handle, returned from the driver's
2094  open routine
2095  Returns:
2096  None
2097  Example:
2098  <code>
2099  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2100  DRV_TMR_Close ( handle );
2101  </code>
2102  Remarks:
2103  After calling this function, the handle passed in "handle" must not be used
2104  with any of the remaining driver functions. A new handle must be obtained
2105  by calling DRV_TMR_Open before the caller may use the driver again.
2106  Note: Usually there is no need for the driver client to verify that the Close
2107  operation has completed.
2108 */
2109 
2110 void
2111  DRV_TMR_Close (
2112  DRV_HANDLE handle ) ;
2113 // *****************************************************************************
2114 /* Function:
2115  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2116  Summary:
2117  Gets the status of the client operation.
2118  <p><b>Implementation:</b> Dynamic</p>
2119  Description:
2120  This function gets the status of the recently completed client level
2121  operation.
2122  Precondition:
2123  The DRV_TMR_Initialize function must have been called for the specified
2124  Timer driver instance.
2125  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2126  Parameters:
2127  handle - A valid open-instance handle, returned from the driver's
2128  open routine
2129  Returns:
2130  None
2131  Example:
2132  <code>
2133  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2134  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2135  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2136  </code>
2137  Remarks:
2138  None.
2139 */
2140 
2143  DRV_HANDLE handle ) ;
2144 // *****************************************************************************
2145 // *****************************************************************************
2146 // Section: TMR Driver Counting functions
2147 // *****************************************************************************
2148 // *****************************************************************************
2149 // *****************************************************************************
2150 /* Function:
2151  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2152  Summary:
2153  Updates the Timer's counter register.
2154  <p><b>Implementation:</b> Static/Dynamic</p>
2155  Description:
2156  This function updates the Timer's value in the counter register.
2157  Precondition:
2158  The DRV_TMR_Initialize function must have been called.
2159  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2160  Parameters:
2161  handle - A valid open-instance handle, returned from the driver's
2162  open routine
2163  counterPeriod - counter period value
2164  - a 16 bit value if the timer is configured in 16 bit mode
2165  - a 32 bit value if the timer is configured in 32 bit mode
2166  Returns:
2167  None.
2168  Example:
2169  <code>
2170  </code>
2171  Remarks:
2172  None.
2173 */
2174 
2175 void
2177  DRV_HANDLE handle ,
2178  uint32_t counterPeriod ) ;
2179 // *****************************************************************************
2180 /* Function:
2181  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2182  Summary:
2183  Reads the Timer's counter register.
2184  <p><b>Implementation:</b> Static/Dynamic</p>
2185  Description:
2186  This function returns the Timer's value in the counter register.
2187  Precondition:
2188  The DRV_TMR_Initialize function must have been called.
2189  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2190  Parameters:
2191  handle - A valid open-instance handle, returned from the driver's
2192  open routine
2193  Returns:
2194  Timer current period:
2195  - a 16 bit value if the timer is configured in 16 bit mode
2196  - a 32 bit value if the timer is configured in 32 bit mode
2197  Example:
2198  <code>
2199  //Example to use timer for precision time measurement
2200  //without configuring an alarm (interrupt based)
2201  char appState = 0;
2202  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2203  switch ( appState )
2204  {
2205  case 0:
2206  //Calculate and set the counter period
2207  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2208  //counter starts
2209  DRV_TMR_Start ( tmrHandle );
2210  //Trigger an application operation
2211  app_trigger_operation();
2212  //Check for time-out in the next state
2213  appState++;
2214  case 1:
2215  //Overflows and stops at 0 if no alarm is set
2216  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2217  {
2218  //Time-out
2219  return false;
2220  }
2221  else if ( app_operation_isComplete( ) )
2222  {
2223  //Operation is complete before time-out
2224  return true;
2225  }
2226  </code>
2227  Remarks:
2228  None.
2229 */
2230 
2231 uint32_t
2233  DRV_HANDLE handle ) ;
2234 // *****************************************************************************
2235 /* Function:
2236  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2237  Summary:
2238  Clears the Timer's counter register.
2239  <p><b>Implementation:</b> Static/Dynamic</p>
2240  Description:
2241  This function clears the Timer's value in the counter register.
2242  Precondition:
2243  The DRV_TMR_Initialize function must have been called.
2244  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2245  Parameters:
2246  handle - A valid open-instance handle, returned from the driver's
2247  open routine
2248  Returns:
2249  None.
2250  Example:
2251  <code>
2252  </code>
2253  Remarks:
2254  None.
2255 */
2256 
2257 void
2259  DRV_HANDLE handle ) ;
2260 // *****************************************************************************
2261 /* Function:
2262  bool DRV_TMR_AlarmRegister
2263  (
2264  DRV_HANDLE handle,
2265  uint32_t divider,
2266  bool isPeriodic,
2267  uintptr_t context,
2268  DRV_TMR_CALLBACK callBack
2269  )
2270  Summary:
2271  Sets up an alarm.
2272  <p><b>Implementation:</b> Dynamic</p>
2273  Description:
2274  This function sets up an alarm, allowing the client to receive a callback
2275  from the driver when the timer counter reaches zero. Alarms can be one-shot
2276  or periodic. A periodic alarm will reload the timer and generate alarm
2277  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2278  divider;
2279  Precondition:
2280  The DRV_TMR_Initialize function must have been called.
2281  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2282  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2283  Parameters:
2284  handle - A valid handle, returned from DRV_TMR_Open
2285  divider - The value to divide the timer clock source to obtain the
2286  required alarm frequency.
2287  - a 16 bit value if the timer is configured in 16 bit mode
2288  - a 32 bit value if the timer is configured in 32 bit mode
2289  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2290  context - A reference, call back function will be called with the same
2291  reference.
2292  callBack - A call back function which will be called on time out.
2293  Returns:
2294  - true - if the call succeeded
2295  - false - the obtained divider could not be obtained or the passed handle was invalid
2296  Example:
2297  <code>
2298  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2299  void setupTask ()
2300  {
2301  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2302  uint32_t myFreq = 1000; // 1KHz
2303  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2304  // calculate the divider needed
2305  uint32_t divider = clkFreq / myFreq;
2306  // Start the alarm
2307  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2308  {
2309  // divider value could not be obtain;
2310  // handle the error
2311  //
2312  }
2313  }
2314  </code>
2315  Remarks:
2316  The divider value will be truncated to a 16 bit value if the timer is
2317  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2318  callback.
2319 */
2320 
2321 bool
2323  DRV_HANDLE handle ,
2324  uint32_t divider ,
2325  bool isPeriodic ,
2326  uintptr_t context ,
2327  DRV_TMR_CALLBACK callBack ) ;
2328 // *****************************************************************************
2329 /* Function:
2330  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2331  Summary:
2332  Disables an alarm signal.
2333  <p><b>Implementation:</b> Dynamic</p>
2334  Description:
2335  This function allows the client to disable an alarm generation.
2336  Use DRV_TMR_AlarmEnable to re-enable.
2337  Precondition:
2338  The DRV_TMR_Initialize function must have been called.
2339  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2340  A client alarm must be active.
2341  Parameters:
2342  handle - A valid handle, returned from DRV_TMR_Open
2343  Returns:
2344  The current status of the alarm:
2345  - true if the alarm was currently enabled
2346  - false if the alarm was currently disabled
2347  Example:
2348  <code>
2349  </code>
2350  Remarks:
2351  When the driver operates in interrupts this call resolves to a device
2352  interrupt disable.
2353  Do NOT disable the timer except for very short periods of time. If the time
2354  that the interrupt is disabled is longer than a wrap around period and the
2355  interrupt is missed, the hardware has no means of recovering and the
2356  resulting timing will be inaccurate.
2357 */
2358 
2359 bool
2361  DRV_HANDLE handle ) ;
2362 // *****************************************************************************
2363 /* Function:
2364  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2365  Summary:
2366  Re-enables an alarm signal.
2367  <p><b>Implementation:</b> Dynamic</p>
2368  Description:
2369  This function allows the client to re-enable an alarm after it has been
2370  disabled by a DRV_TMR_AlarmDisable call.
2371  Precondition:
2372  The DRV_TMR_Initialize function must have been called.
2373  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2374  Parameters:
2375  handle - A valid handle, returned from DRV_TMR_Open
2376  enable - boolean to enable the current callback
2377  Returns:
2378  None
2379  Example:
2380  <code>
2381  </code>
2382  Remarks:
2383  When the driver operates in interrupts this call resolves to a device
2384  interrupt re-enable.
2385 */
2386 
2387 void
2389  DRV_HANDLE handle ,
2390  bool enable ) ;
2391 // *****************************************************************************
2392 /* Function:
2393  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2394  Summary:
2395  Updates the Timer's period.
2396  <p><b>Implementation:</b> Dynamic</p>
2397  Description:
2398  This function updates the Timer's period.
2399  Precondition:
2400  The DRV_TMR_Initialize function must have been called.
2401  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2402  Parameters:
2403  handle - A valid open-instance handle, returned from the driver's
2404  open routine
2405  value - Period value
2406  - a 16 bit value if the timer is configured in 16 bit mode
2407  - a 32 bit value if the timer is configured in 32 bit mode
2408  Returns:
2409  None.
2410  Example:
2411  <code>
2412  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2413  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2414  </code>
2415  Remarks:
2416  - The period value will be truncated to a 16 bit value if the timer is
2417  configured in 16 bit mode.
2418 */
2419 
2420 void
2422  DRV_HANDLE handle ,
2423  uint32_t value ) ;
2424 // *****************************************************************************
2425 /* Function:
2426  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2427  Summary:
2428  Provides the Timer's period.
2429  <p><b>Implementation:</b> Dynamic</p>
2430  Description:
2431  This function gets the Timer's period.
2432  Precondition:
2433  The DRV_TMR_Initialize function must have been called.
2434  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2435  Parameters:
2436  handle - A valid open-instance handle, returned from the driver's
2437  open routine
2438  Returns:
2439  Timer period value:
2440  - a 16 bit value if the timer is configured in 16 bit mode
2441  - a 32 bit value if the timer is configured in 32 bit mode
2442  Example:
2443  <code>
2444  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2445  uint32_t period;
2446  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2447  </code>
2448  Remarks:
2449  None.
2450 */
2451 
2452 uint32_t
2454  DRV_HANDLE handle ) ;
2455 // *****************************************************************************
2456 /* Function:
2457  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2458  Summary:
2459  Removes a previously set alarm.
2460  <p><b>Implementation:</b> Dynamic</p>
2461  Description:
2462  This function removes a previously set alarm.
2463  Precondition:
2464  The DRV_TMR_Initialize function must have been called.
2465  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2466  DRV_TMR_AlarmRegister function must have been called before.
2467  Parameters:
2468  handle - A valid open-instance handle, returned from the driver's
2469  open routine
2470  Returns:
2471  None.
2472  Example:
2473  <code>
2474  // Example of a key debounce check
2475  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2476  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2477  void keyPressDetect ()
2478  {
2479  // Calculate the count to be passed on from the clock input
2480  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2481  }
2482  void DebounceCheck ( uintptr_t context )
2483  {
2484  readKey = AppReadKey();
2485  if ( readKey != lastReadKey )
2486  {
2487  lastReadKey = readKey;
2488  keyCount = 0;
2489  }
2490  else
2491  {
2492  if ( keyCount > 20 )
2493  {
2494  globalKeyState = readKey;
2495  DRV_TMR_AlarmDeregister ( tmrHandle );
2496  }
2497  keyCount++;
2498  }
2499  }
2500  </code>
2501  Remarks:
2502  None.
2503 */
2504 
2505 void
2507  DRV_HANDLE handle ) ;
2508 // *****************************************************************************
2509 // *****************************************************************************
2510 // Section: TMR Driver Operation Control Functions
2511 // *****************************************************************************
2512 // *****************************************************************************
2513 // *****************************************************************************
2514 /* Function:
2515  bool DRV_TMR_Start ( DRV_HANDLE handle )
2516  Summary:
2517  Starts the Timer counting.
2518  <p><b>Implementation:</b> Static/Dynamic</p>
2519  Description:
2520  This function starts the Timer counting.
2521  Precondition:
2522  The DRV_TMR_Initialize function must have been called.
2523  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2524  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2525  Parameters:
2526  handle - A valid open-instance handle, returned from the driver's
2527  open routine
2528  Returns:
2529  - true - if the operation succeeded
2530  - false - the supplied handle is invalid or the client doesn't have
2531  the needed parameters to run (alarm callback and period )
2532  Example:
2533  <code>
2534  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2535  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2536  DRV_TMR_Start ( tmrHandle );
2537  </code>
2538  Remarks:
2539  None.
2540 */
2541 
2542 bool
2543  DRV_TMR_Start (
2544  DRV_HANDLE handle ) ;
2545 // *****************************************************************************
2546 /* Function:
2547  void DRV_TMR_Stop ( DRV_HANDLE handle )
2548  Summary:
2549  Stops the Timer from counting.
2550  <p><b>Implementation:</b> Static/Dynamic</p>
2551  Description:
2552  This function stops the running Timer from counting.
2553  Precondition:
2554  The DRV_TMR_Initialize function must have been called.
2555  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2556  Parameters:
2557  handle - A valid open-instance handle, returned from the driver's
2558  open routine
2559  Returns:
2560  None.
2561  Example:
2562  <code>
2563  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2564  DRV_TMR_Stop ( handle );
2565  </code>
2566  Remarks:
2567  None.
2568 */
2569 
2570 void
2571  DRV_TMR_Stop (
2572  DRV_HANDLE handle ) ;
2573 // *****************************************************************************
2574 // *****************************************************************************
2575 // Section: TMR Driver Operation Status Functions
2576 // *****************************************************************************
2577 // *****************************************************************************
2578 // *****************************************************************************
2579 /* Function:
2580  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2581  Summary:
2582  Provides the status of Timer's period elapse.
2583  <p><b>Implementation:</b> Dynamic</p>
2584  Description:
2585  This function returns the number of times Timer's period has elapsed since
2586  last call to this API has made. On calling this API, the internally
2587  maintained counter will be cleared and count will be started again from next
2588  elapse.
2589  Precondition:
2590  The DRV_TMR_Initialize function must have been called.
2591  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2592  Parameters:
2593  handle - A valid handle, returned from the DRV_TMR_Open
2594  Returns:
2595  Number of times timer has elapsed since the last call.
2596  Example:
2597  <code>
2598  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2599  bool elapseStatus;
2600  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2601  unsigned int appInternalTime = 0;
2602  Sys_Tasks()
2603  {
2604  //Timer task will be called from ISR
2605  APP_TimeUpdate_Task();
2606  //Other Tasks
2607  }
2608  void APP_TimeUpdate_Task ( void )
2609  {
2610  //We will not miss a count even though we are late
2611  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2612  }
2613  </code>
2614  Remarks:
2615  None.
2616 */
2617 
2618 uint32_t
2620  DRV_HANDLE handle ) ;
2621 // *****************************************************************************
2622 // *****************************************************************************
2623 // Section: TMR Driver Control and Information Functions
2624 // *****************************************************************************
2625 // *****************************************************************************
2626 // *****************************************************************************
2627 /* Function:
2628  bool DRV_TMR_ClockSet
2629  (
2630  DRV_HANDLE handle,
2631  DRV_TMR_CLK_SOURCES clockSource,
2632  TMR_PRESCALE preScale
2633  )
2634  Summary:
2635  Sets the timers clock by selecting the source and prescaler.
2636  <p><b>Implementation:</b> Dynamic</p>
2637  Description:
2638  This function sets the timer clock by selecting the source and prescaler.
2639  The clock sources are device specific, refer device datasheet for supported
2640  clock sources. If unsupported clock source is passed then the behaviour of
2641  this function is unpredictable.
2642  Precondition:
2643  The DRV_TMR_Initialize function must have been called. Must have selected
2644  32-Bit timer mode if mode selection is applicable.
2645  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2646  Parameters:
2647  handle - A valid open-instance handle, returned from the driver's
2648  open routine
2649  clockSource - Clock source of the timer
2650  preScale - Timer's Prescaler divisor
2651  Returns:
2652  - true - if the operation is successful
2653  - false - either the handle is invalid or the clockSource
2654  and/or prescaler are not supported
2655  Example:
2656  <code>
2657  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2658  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2659  </code>
2660  Remarks:
2661  None.
2662 */
2663 
2664 bool
2666  DRV_HANDLE handle ,
2667  DRV_TMR_CLK_SOURCES clockSource ,
2668  TMR_PRESCALE preScale ) ;
2669 // *****************************************************************************
2670 /* Function:
2671  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2672  Summary:
2673  This function gets the currently selected prescaler.
2674  <p><b>Implementation:</b> Dynamic</p>
2675  Description:
2676  This function gets the currently selected prescaler.
2677  Precondition:
2678  The DRV_TMR_Initialize function must have been called.
2679  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2680  Parameters:
2681  handle - A valid open-instance handle, returned from the driver's
2682  open routine
2683  Returns:
2684  Timer prescaler.
2685  Example:
2686  <code>
2687  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2688  TMR_PRESCALE preScale;
2689  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2690  </code>
2691  Remarks:
2692  None.
2693 */
2694 
2695 TMR_PRESCALE
2697  DRV_HANDLE handle ) ;
2698 // *****************************************************************************
2699 /* Function:
2700  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2701  Summary:
2702  This function gets the currently selected operation mode.
2703  <p><b>Implementation:</b> Dynamic</p>
2704  Description:
2705  This function gets the currently selected 16/32 bit operation mode.
2706  Precondition:
2707  The DRV_TMR_Initialize function must have been called.
2708  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2709  Parameters:
2710  handle - A valid open-instance handle, returned from the driver's
2711  open routine
2712  Returns:
2713  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2714  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2715  handle.
2716  Example:
2717  <code>
2718  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2719  DRV_TMR_OPERATION_MODE operMode;
2720  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2721  </code>
2722  Remarks:
2723  None.
2724 */
2725 
2728  DRV_HANDLE handle ) ;
2729 // *****************************************************************************
2730 /* Function:
2731  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2732  Summary:
2733  Enables the Gate mode.
2734  <p><b>Implementation:</b> Dynamic</p>
2735  Description:
2736  This function enables the Gated mode of Timer. User can measure the duration
2737  of an external signal in this mode. Once the Gate mode is enabled, Timer
2738  will start on the raising edge of the external signal. It will keep counting
2739  until the next falling edge.
2740  Precondition:
2741  The DRV_TMR_Initialize function must have been called.
2742  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2743  Parameters:
2744  handle - A valid open-instance handle, returned from the driver's
2745  open routine
2746  Returns:
2747  - true - if the operation is successful
2748  - false - either the handle is invalid or the gate mode
2749  is not supported
2750  Example:
2751  <code>
2752  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2753  DRV_TMR_GateModeSet ( tmrHandle );
2754  </code>
2755  Remarks:
2756  None.
2757 */
2758 
2759 bool
2761  DRV_HANDLE handle ) ;
2762 // *****************************************************************************
2763 /* Function:
2764  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2765  Summary:
2766  Enables the Gate mode.
2767  <p><b>Implementation:</b> Dynamic</p>
2768  Description:
2769  This function enables the Gated mode of Timer. User can measure the duration
2770  of an external signal in this mode. Once the Gate mode is enabled, Timer
2771  will start on the raising edge of the external signal. It will keep counting
2772  until the next falling edge.
2773  Precondition:
2774  The DRV_TMR_Initialize function must have been called.
2775  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2776  Parameters:
2777  handle - A valid open-instance handle, returned from the driver's
2778  open routine
2779  Returns:
2780  - true - if the operation is successful
2781  - false - either the handle is invalid or the gate mode
2782  is not supported
2783  Example:
2784  <code>
2785  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2786  DRV_TMR_GateModeClear ( tmrHandle );
2787  </code>
2788  Remarks:
2789  None.
2790 */
2791 
2792 bool
2794  DRV_HANDLE handle ) ;
2795 // *****************************************************************************
2796 /* Function:
2797  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2798  Summary:
2799  Provides the Timer input frequency.
2800  <p><b>Implementation:</b> Dynamic</p>
2801  Description:
2802  This function provides the Timer input frequency. Input frequency is the
2803  clock to the Timer register and it is considering the prescaler divisor.
2804  Precondition:
2805  The DRV_TMR_Initialize function must have been called.
2806  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2807  Parameters:
2808  handle - A valid open-instance handle, returned from the driver's
2809  open routine
2810  Returns:
2811  32-bit value corresponding to the running frequency.
2812  If Timer clock source is external, then this function returns 0.
2813  Example:
2814  <code>
2815  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2816  uint32_t clkFreqHz;
2817  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2818  </code>
2819  Remarks:
2820  On most processors, the Timer's base frequency is the same as the peripheral
2821  bus clock.
2822 */
2823 
2824 uint32_t
2826  DRV_HANDLE handle ) ;
2827 // *****************************************************************************
2828 /* Function:
2829  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2830  (
2831  DRV_HANDLE handle,
2832  DRV_TMR_DIVIDER_RANGE* pDivRange
2833  )
2834  Summary:
2835  Returns the Timer divider values.
2836  <p><b>Implementation:</b> Dynamic</p>
2837  Description:
2838  This function provides the Timer operating mode and divider range.
2839  Precondition:
2840  The DRV_TMR_Initialize function must have been called.
2841  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2842  Parameters:
2843  handle - A valid open-instance handle, returned from the driver's
2844  open routine
2845  pDivRange - Address to store the timer divider range.
2846  Returns:
2847  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2848  The pDivRange is updated with the supported range values.
2849  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2850  Example:
2851  <code>
2852  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2853  DRV_TMR_OPERATION_MODE timerMode;
2854  DRV_TMR_DIVIDER_RANGE timerRange;
2855  DRV_TMR_DividerRangeGet(handle, &timerRange);
2856  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2857  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2858  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2859  </code>
2860  Remarks:
2861  None.
2862 */
2863 
2866  DRV_HANDLE handle ,
2867  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2868 // *****************************************************************************
2869 // *****************************************************************************
2870 // Section: File includes for the APIs which are required for backward
2871 // compatibility.
2872 // *****************************************************************************
2873 // *****************************************************************************
2874 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2875 /*******************************************************************************
2876  Timer Device Driver Interface Definition
2877  Company:
2878  Microchip Technology Inc.
2879  File Name:
2880  drv_tmr_compatibility.h
2881  Summary:
2882  Timer device driver interface header file.
2883  Description:
2884  This header file contains macro definition for APIs which will be deprecated
2885  later. This header file is included in drv_tmr.h.
2886 *******************************************************************************/
2887 //DOM-IGNORE-BEGIN
2888 /*******************************************************************************
2889 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2890 Microchip licenses to you the right to use, modify, copy and distribute
2891 Software only when embedded on a Microchip microcontroller or digital signal
2892 controller that is integrated into your product or third party product
2893 (pursuant to the sublicense terms in the accompanying license agreement).
2894 You should refer to the license agreement accompanying this Software for
2895 additional information regarding your rights and obligations.
2896 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2897 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2898 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2899 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2900 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2901 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2902 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2903 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2904 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2905 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2906 *******************************************************************************/
2907 //DOM-IGNORE-END
2908 #ifndef _DRV_TMR_DEPRECATED_H
2909 #define _DRV_TMR_DEPRECATED_H
2910 // *****************************************************************************
2911 // *****************************************************************************
2912 // Section: File includes
2913 // *****************************************************************************
2914 // *****************************************************************************
2915 // *****************************************************************************
2916 /* Function:
2917  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
2918  Summary:
2919  Maintains the driver's state machine, processes the events and implements
2920  its ISR.
2921  <p><b>Implementation:</b> Dynamic</p>
2922  Description:
2923  This function is used to maintain the driver's internal state machine and
2924  processes the timer events in interrupt-driven implementations
2925  (DRV_TMR_INTERRUPT_MODE == true).
2926  Precondition:
2927  The DRV_TMR_Initialize function must have been called for the specified Timer
2928  driver instance.
2929  Parameters:
2930  object - Object handle for the specified driver instance (returned from
2931  DRV_TMR_Initialize)
2932  Returns:
2933  None
2934  Example:
2935  <code>
2936  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
2937  {
2938  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
2939  }
2940  </code>
2941  Remarks:
2942  This function is normally not called directly by an application.
2943  It is called by the timer driver raw ISR.
2944  This function will execute in an ISR context and will never block or access any
2945  resources that may cause it to block.
2946 
2947  This function will be deprecated later, so avoid using it as much as possible.
2948  Use generic function "DRV_TMR_Tasks" instead of this.
2949 */
2950 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
2951 // *****************************************************************************
2952 /* Function:
2953  void DRV_TMR_CounterValue16BitSet
2954  (
2955  DRV_HANDLE handle,
2956  uint16_t counterPeriod
2957  )
2958  Summary:
2959  Updates the 16-bit Timer's counter register.
2960  <p><b>Implementation:</b> Dynamic</p>
2961  Description:
2962  This function updates the 16-bit Timer's value in the counter register. This
2963  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
2964  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
2965  DRV_TMR_CounterValue32BitSet function.
2966  Precondition:
2967  The DRV_TMR_Initialize function must have been called. Must have selected
2968  16-Bit timer mode if mode selection is applicable.
2969  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2970  Parameters:
2971  handle - A valid open-instance handle, returned from the driver's
2972  open routine
2973  counterPeriod - 16-bit counter period value
2974  Returns:
2975  None.
2976  Example:
2977  <code>
2978  //Example to use timer for precision time measurement
2979  //without configuring an alarm (interrupt based)
2980  char appState = 0;
2981  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2982 
2983  switch ( appState )
2984  {
2985  case 0:
2986  //Calculate and set the counter period
2987  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2988 
2989  //counter starts
2990  DRV_TMR_Start ( tmrHandle );
2991 
2992  //Trigger an application operation
2993  app_trigger_operation();
2994 
2995  //Check for time-out in the next state
2996  appState++;
2997  case 1:
2998  //Overflows and stops at 0 if no alarm is set
2999  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3000  {
3001  //Time-out
3002  return false;
3003  }
3004  else if ( app_operation_isComplete( ) )
3005  {
3006  //Operation is complete before time-out
3007  return true;
3008  }
3009  </code>
3010  Remarks:
3011  This function will be deprecated later, so avoid using it as much as possible.
3012  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3013 */
3014 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3015 // *****************************************************************************
3016 /* Function:
3017  void DRV_TMR_CounterValue32BitSet
3018  (
3019  DRV_HANDLE handle,
3020  uint32_t counterPeriod
3021  )
3022  Summary:
3023  Updates the 32-bit Timer's counter register.
3024  <p><b>Implementation:</b> Dynamic</p>
3025  Description:
3026  This function updates the 32-bit Timer's value in the counter register. This
3027  is valid only if the 32-bit mode of the timer is selected Otherwise use
3028  DRV_TMR_CounterValue16BitSet function.
3029  Precondition:
3030  The DRV_TMR_Initialize function must have been called. Must have selected
3031  32-Bit timer mode.
3032  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3033  Parameters:
3034  handle - A valid open-instance handle, returned from the driver's
3035  open routine
3036  counterPeriod - 32-bit counter period value
3037  Returns:
3038  None.
3039  Example:
3040  <code>
3041  //Example to use timer for precision time measurement
3042  //without configuring an alarm (interrupt based)
3043  char appState = 0;
3044  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3045 
3046  switch ( appState )
3047  {
3048  case 0:
3049  //Calculate and set the counter period
3050  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3051 
3052  //counter starts
3053  DRV_TMR_Start ( tmrHandle );
3054 
3055  //Trigger an application operation against which we want to use the time-out
3056  app_trigger_operation();
3057 
3058  //Check for time-out in the next state
3059  appState++;
3060  case 1:
3061  //Overflows and stops at 0 if no alarm is set
3062  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3063  {
3064  //Time-out
3065  return false;
3066  }
3067  else if ( app_operation_isComplete( ) )
3068  {
3069  //Operation is complete before time-out
3070  return true;
3071  }
3072  </code>
3073  Remarks:
3074  In most of the devices only even numbered instances of timer supports
3075  32-bit mode.
3076  This function will be deprecated later, so avoid using it as much as possible.
3077  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3078 */
3079 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3080 // *****************************************************************************
3081 /* Function:
3082  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3083  Summary:
3084  Reads the 16-bit Timer's counter register.
3085  <p><b>Implementation:</b> Dynamic</p>
3086  Description:
3087  This function returns the 16-bit Timer's value in the counter register. This
3088  is valid only if the 16-bit mode of the timer is selected.
3089  Otherwise use DRV_TMR_CounterValue32BitGet function.
3090  Precondition:
3091  The DRV_TMR_Initialize function must have been called. Must have selected
3092  16-Bit timer mode if mode selection is applicable.
3093  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3094  Parameters:
3095  handle - A valid open-instance handle, returned from the driver's
3096  open routine
3097 
3098  Returns:
3099  Timer period in 16-bit mode.
3100  Example:
3101  <code>
3102  //Example to use timer for precision time measurement
3103  //without configuring an alarm (interrupt based)
3104  char appState = 0;
3105  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3106 
3107  switch ( appState )
3108  {
3109  case 0:
3110  //Calculate and set the counter period
3111  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3112 
3113  //counter starts
3114  DRV_TMR_Start ( tmrHandle );
3115 
3116  //Trigger an application operation
3117  app_trigger_operation();
3118 
3119  //Check for time-out in the next state
3120  appState++;
3121  case 1:
3122  //Overflows and stops at 0 if no alarm is set
3123  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3124  {
3125  //Time-out
3126  return false;
3127  }
3128  else if ( app_operation_isComplete( ) )
3129  {
3130  //Operation is complete before time-out
3131  return true;
3132  }
3133  </code>
3134  Remarks:
3135  This function will be deprecated later, so avoid using it as much as possible.
3136  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3137 */
3138 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3139 // *****************************************************************************
3140 /* Function:
3141  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3142  Summary:
3143  Reads the 32-bit Timer's counter register.
3144  <p><b>Implementation:</b> Dynamic</p>
3145  Description:
3146  This function returns the 32-bit Timer's value in the counter register. This
3147  is valid only if the 32-bit mode of the timer is selected Otherwise use
3148  DRV_TMR_CounterValue16BitGet function.
3149  Precondition:
3150  The DRV_TMR_Initialize function must have been called. Must have selected
3151  32-Bit timer mode.
3152  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3153  Parameters:
3154  handle - A valid open-instance handle, returned from the driver's
3155  open routine
3156 
3157  Returns:
3158  32-Bit Counter value.
3159  Example:
3160  <code>
3161  //Example to use timer for precision time measurement
3162  //without configuring an alarm (interrupt based)
3163  char appState = 0;
3164  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3165 
3166  switch ( appState )
3167  {
3168  case 0:
3169  //Calculate and set the counter period
3170  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3171 
3172  //counter starts
3173  DRV_TMR_Start ( tmrHandle );
3174 
3175  //Trigger an application operation
3176  app_trigger_operation();
3177 
3178  //Check for time-out in the next state
3179  appState++;
3180  case 1:
3181  //Overflows and stops at 0 if no alarm is set
3182  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3183  {
3184  //Time-out
3185  return false;
3186  }
3187  else if ( app_operation_isComplete( ) )
3188  {
3189  //Operation is complete before time-out
3190  return true;
3191  }
3192  </code>
3193  Remarks:
3194  In most of the devices only even numbered instances of timer supports
3195  32-bit mode.
3196  This function will be deprecated later, so avoid using it as much as possible.
3197  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3198 */
3199 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3200 // *****************************************************************************
3201 /* Function:
3202  void DRV_TMR_Alarm16BitRegister
3203  (
3204  DRV_HANDLE handle,
3205  uint16_t period,
3206  bool isPeriodic,
3207  uintptr_t context,
3208  DRV_TMR_CALLBACK callBack
3209  )
3210  Summary:
3211  Sets up an alarm.
3212  <p><b>Implementation:</b> Dynamic</p>
3213  Description:
3214  This function sets up an alarm, allowing the client to receive a callback
3215  from the driver when the counter period elapses. Alarms can be one-shot or
3216  periodic. This API is valid only if the 16-bit mode of the timer is
3217  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3218  Precondition:
3219  The DRV_TMR_Initialize function must have been called. Must have selected
3220  16-Bit timer mode if mode selection is applicable.
3221  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3222  Parameters:
3223  handle - A valid handle, returned from DRV_TMR_Open
3224  period - 16-bit period which will be loaded into the Timer hardware register.
3225 
3226  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3227 
3228  context - A reference, call back function will be called with the same
3229  reference.
3230 
3231  callBack - A call back function which will be called on period elapse.
3232 
3233  Returns:
3234  None
3235  Example:
3236  <code>
3237  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3238 
3239  void setupTask ()
3240  {
3241  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3242 
3243  // Calculate the count to be passed on from the clock input
3244  //Periodically toggle LED
3245  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3246  ToggleLedCallBack );
3247  }
3248 
3249  void ToggleLedCallBack ( uintptr_t context )
3250  {
3251  //Toggle
3252  }
3253  </code>
3254  Remarks:
3255  This function will be deprecated later, so avoid using it as much as possible.
3256  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3257 */
3258 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3259 // *****************************************************************************
3260 /* Function:
3261  void DRV_TMR_Alarm32BitRegister
3262  (
3263  DRV_HANDLE handle,
3264  uint32_t period,
3265  bool isPeriodic,
3266  uintptr_t context,
3267  DRV_TMR_CALLBACK callBack
3268  )
3269  Summary:
3270  Sets up an alarm.
3271  <p><b>Implementation:</b> Dynamic</p>
3272  Description:
3273  This function sets up an alarm, allowing the client to receive a callback
3274  from the driver when the counter period elapses. Alarms can be one-shot or
3275  periodic. This API is valid only if the 32-bit mode of the timer is
3276  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3277  Precondition:
3278  The DRV_TMR_Initialize function must have been called. Must have selected
3279  32-Bit timer mode.
3280  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3281  Parameters:
3282  handle - A valid handle, returned from DRV_TMR_Open
3283  period - 32-bit period which will be loaded into the Timer hardware register.
3284 
3285  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3286 
3287  context - A reference, call back function will be called with the same
3288  reference.
3289 
3290  callBack - A call back function which will be called on period elapse.
3291 
3292  Returns:
3293  None
3294  Example:
3295  <code>
3296  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3297 
3298  void setupTask ()
3299  {
3300  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3301 
3302  // Calculate the count to be passed on from the clock input
3303  //Periodically toggle LED
3304  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3305  ToggleLedCallBack );
3306  }
3307 
3308  void ToggleLedCallBack ( uintptr_t context )
3309  {
3310  //Toggle
3311  }
3312  </code>
3313  Remarks:
3314  In most of the devices only even numbered instances of timer supports
3315  32-bit mode.
3316  This function will be deprecated later, so avoid using it as much as possible.
3317  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3318 */
3319 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3320 // *****************************************************************************
3321 /* Function:
3322  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3323  Summary:
3324  Updates the 16-bit Timer's period.
3325  <p><b>Implementation:</b> Dynamic</p>
3326  Description:
3327  This function updates the 16-bit Timer's period. This API is valid only if
3328  the 16-bit mode of the timer is selected
3329  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3330  Precondition:
3331  The DRV_TMR_Initialize function must have been called. Must have selected
3332  16-Bit timer mode if mode selection is applicable.
3333  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3334  Parameters:
3335  handle - A valid open-instance handle, returned from the driver's
3336  open routine
3337  value - 16-bit Period value
3338  Returns:
3339  None.
3340  Example:
3341  <code>
3342  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3343  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3344  </code>
3345  Remarks:
3346  This function will be deprecated later, so avoid using it as much as possible.
3347  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3348 */
3349 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3350 // *****************************************************************************
3351 /* Function:
3352  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3353  Summary:
3354  Updates the 32-bit Timer's period.
3355  <p><b>Implementation:</b> Dynamic</p>
3356  Description:
3357  This function updates the 32-bit Timer's period. This API is valid only if
3358  the 32-bit mode of the timer is selected
3359  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3360  Precondition:
3361  The DRV_TMR_Initialize unction must have been called. Must have selected
3362  32-Bit timer mode.
3363  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3364  Parameters:
3365  handle - A valid open-instance handle, returned from the driver's
3366  open routine
3367  period - 32-bit Period value
3368  Returns:
3369  None.
3370  Example:
3371  <code>
3372  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3373  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3374  </code>
3375  Remarks:
3376  In most of the devices only even numbered instances of timer supports
3377  32-bit mode.
3378  This function will be deprecated later, so avoid using it as much as possible.
3379  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3380 */
3381 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3382 // *****************************************************************************
3383 /* Function:
3384  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3385  Summary:
3386  Provides the 16-bit Timer's period.
3387  <p><b>Implementation:</b> Dynamic</p>
3388  Description:
3389  This function gets the 16-bit Timer's period. This API is valid only if
3390  the 16-bit mode of the timer is selected.
3391  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3392  Precondition:
3393  The DRV_TMR_Initialize function must have been called. Must have selected
3394  16-Bit timer mode if mode selection is applicable.
3395  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3396  Parameters:
3397  handle - A valid open-instance handle, returned from the driver's
3398  open routine
3399  Returns:
3400  16-bit timer period value
3401  Example:
3402  <code>
3403  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3404  uint16_t period;
3405 
3406  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3407  </code>
3408  Remarks:
3409  This function will be deprecated later, so avoid using it as much as possible.
3410  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3411 */
3412 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3413 // *****************************************************************************
3414 /* Function:
3415  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3416  Summary:
3417  Provides the 32-bit Timer's period.
3418  <p><b>Implementation:</b> Dynamic</p>
3419  Description:
3420  This function gets the 32-bit Timer's period. This API is valid only if
3421  the 32-bit mode of the timer is selected
3422  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3423  Precondition:
3424  The DRV_TMR_Initialize function must have been called. Must have selected
3425  32-Bit timer mode.
3426  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3427  Parameters:
3428  handle - A valid open-instance handle, returned from the driver's
3429  open routine
3430  Returns:
3431  32-bit Timer period value.
3432  Example:
3433  <code>
3434  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3435  uint32_t period;
3436  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3437  </code>
3438  Remarks:
3439  In most of the devices only even numbered instances of timer supports
3440  32-bit mode.
3441  This function will be deprecated later, so avoid using it as much as possible.
3442  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3443 */
3444 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3445 // *****************************************************************************
3446 /* Function:
3447  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3448  Summary:
3449  Removes a previously set alarm.
3450  <p><b>Implementation:</b> Dynamic</p>
3451  Description:
3452  This function removes a previously set alarm. This API is valid only if
3453  the 16-bit mode of the timer is selected
3454  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3455  Precondition:
3456  The DRV_TMR_Initialize function must have been called. Must have selected
3457  16-Bit timer mode if mode selection is applicable.
3458  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3459 
3460  DRV_TMR_Alarm16BitRegister function must have been called before.
3461  Parameters:
3462  handle - A valid open-instance handle, returned from the driver's
3463  open routine
3464  Returns:
3465  None.
3466  Example:
3467  <code>
3468  //Example of a key debounce check
3469 
3470  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3471  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3472  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3473 
3474  void keyPressDetect ()
3475  {
3476  // Calculate the count to be passed on from the clock input
3477  //Periodically toggle LED
3478  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3479  DebounceCheck );
3480  }
3481 
3482  void DebounceCheck ( uintptr_t context )
3483  {
3484  readKey = AppReadKey();
3485 
3486  if ( readKey != lastReadKey )
3487  {
3488  lastReadKey = readKey;
3489  keyCount = 0;
3490  }
3491  else
3492  {
3493  if ( keyCount > 20 )
3494  {
3495  globalKeyState = readKey;
3496  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3497  }
3498  keyCount++;
3499  }
3500  }
3501  </code>
3502  Remarks:
3503  This function will be deprecated later, so avoid using it as much as possible.
3504  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3505 */
3506 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3507 // *****************************************************************************
3508 /* Function:
3509  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3510  Summary:
3511  Removes a previously set alarm.
3512  <p><b>Implementation:</b> Dynamic</p>
3513  Description:
3514  This function removes a previously set alarm. This API is valid only if
3515  the 32-bit mode of the timer is selected
3516  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3517  Precondition:
3518  The DRV_TMR_Initialize function must have been called. Must have selected
3519  32-Bit timer mode if mode selection is applicable.
3520  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3521 
3522  DRV_TMR_Alarm32BitRegister function must have been called before.
3523  Parameters:
3524  handle - A valid open-instance handle, returned from the driver's
3525  open routine
3526  Returns:
3527  None.
3528  Example:
3529  <code>
3530  //Example of a key debounce check
3531 
3532  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3533  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3534  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3535 
3536  void keyPressDetect ( void )
3537  {
3538  // Calculate the count to be passed on from the clock input
3539  //Periodically check the key status
3540  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3541  DebounceCheck );
3542  }
3543 
3544  void DebounceCheck ( uintptr_t context )
3545  {
3546  readKey = AppReadKey();
3547 
3548  if ( readKey != lastReadKey )
3549  {
3550  lastReadKey = readKey;
3551  keyCount = 0;
3552  }
3553  else
3554  {
3555  if ( keyCount > 20 )
3556  {
3557  //Key is stable now
3558  globalKeyState = readKey;
3559  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3560  }
3561  keyCount++;
3562  }
3563  }
3564  </code>
3565  Remarks:
3566  In most of the devices only even numbered instances of timer supports
3567  32-bit mode.
3568  This function will be deprecated later, so avoid using it as much as possible.
3569  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3570 */
3571 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3572  // #ifndef _DRV_TMR_DEPRECATED_H
3573 /*******************************************************************************
3574  End of File
3575 */
3576 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3577 /* CLOSE_FILE Include File */
3578 
3579 //DOM-IGNORE-BEGIN
3580 //DOM-IGNORE-END
3581  // #ifndef _DRV_TMR_H
3582 /*******************************************************************************
3583  End of File
3584 */
3585 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3586 /* CLOSE_FILE Include File */
3587 
3588 #include "peripheral/tmr/plib_tmr.h"
3589 #include "peripheral/int/plib_int.h"
3590 // maximum divider value for 32 bit operation mode
3591 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3592 // minimum divider value for 32 bit operation mode
3593 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3594 // maximum divider value for 16 bit operation mode
3595 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3596 // minimum divider value for 16 bit operation mode
3597 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3598 // *****************************************************************************
3599 // *****************************************************************************
3600 // Section: Interface Headers for Instance 0 for the static driver
3601 // *****************************************************************************
3602 // *****************************************************************************
3603 
3604 void
3605  DRV_TMR0_Initialize ( void ) ;
3606 
3607 bool
3608  DRV_TMR0_Start ( void ) ;
3609 
3610 void
3611  DRV_TMR0_Stop ( void ) ;
3612 
3613 static inline void
3615  {
3616  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3617  DRV_TMR0_Stop () ;
3618  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3619  fsk_60zqendz ( 2 ) ; /* 30 */
3620  }
3621 
3622 static inline SYS_STATUS
3624 {
3625  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3626  /* Return the status as ready always */
3627  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3628  fsk_60zqendz ( 4 ) ; /* 30 */
3629  return
3630  SYS_STATUS_READY ;
3631 }
3632 
3633 static inline void
3634  DRV_TMR0_Open ( void )
3635  {
3636  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3637  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3638  fsk_60zqendz ( 6 ) ; /* 30 */
3639  }
3640 
3642  DRV_TMR0_ClientStatus ( void ) ;
3643 
3644 static inline DRV_TMR_OPERATION_MODE
3646 {
3647  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3648  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3649  fsk_60zqendz ( 8 ) ; /* 30 */
3650  return
3652 }
3653 
3654 static inline void
3656  {
3657  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3658  DRV_TMR0_Stop () ;
3659  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3660  fsk_60zqendz ( 10 ) ; /* 30 */
3661  }
3662 
3663 bool
3665  DRV_TMR_CLK_SOURCES clockSource ,
3666  TMR_PRESCALE prescale ) ;
3667 
3668 void
3670  uint32_t value ) ;
3671 
3672 uint32_t
3673  DRV_TMR0_CounterValueGet ( void ) ;
3674 
3675 void
3676  DRV_TMR0_CounterClear ( void ) ;
3677 
3678 TMR_PRESCALE
3679  DRV_TMR0_PrescalerGet ( void ) ;
3680 
3681 void
3683  uint32_t value ) ;
3684 
3685 uint32_t
3686  DRV_TMR0_PeriodValueGet ( void ) ;
3687 
3688 void
3689  DRV_TMR0_StopInIdleDisable ( void ) ;
3690 
3691 void
3692  DRV_TMR0_StopInIdleEnable ( void ) ;
3693 
3694 static inline void
3696  {
3697  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3698  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3699  fsk_60zqendz ( 12 ) ; /* 30 */
3700  }
3701 
3702 uint32_t
3703  DRV_TMR0_CounterFrequencyGet ( void ) ;
3704 
3707  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3708 // *****************************************************************************
3709 // *****************************************************************************
3710 // Section: Interface Headers for Instance 1 for the static driver
3711 // *****************************************************************************
3712 // *****************************************************************************
3713 
3714 void
3715  DRV_TMR1_Initialize ( void ) ;
3716 
3717 bool
3718  DRV_TMR1_Start ( void ) ;
3719 
3720 void
3721  DRV_TMR1_Stop ( void ) ;
3722 
3723 static inline void
3725  {
3726  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3727  DRV_TMR1_Stop () ;
3728  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3729  fsk_60zqendz ( 14 ) ; /* 30 */
3730  }
3731 
3732 static inline SYS_STATUS
3734 {
3735  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3736  /* Return the status as ready always */
3737  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3738  fsk_60zqendz ( 16 ) ; /* 30 */
3739  return
3740  SYS_STATUS_READY ;
3741 }
3742 
3743 static inline void
3744  DRV_TMR1_Open ( void )
3745  {
3746  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3747  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3748  fsk_60zqendz ( 18 ) ; /* 30 */
3749  }
3750 
3752  DRV_TMR1_ClientStatus ( void ) ;
3753 
3754 static inline DRV_TMR_OPERATION_MODE
3756 {
3757  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3758  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3759  fsk_60zqendz ( 20 ) ; /* 30 */
3760  return
3762 }
3763 
3764 static inline void
3766  {
3767  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3768  DRV_TMR1_Stop () ;
3769  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3770  fsk_60zqendz ( 22 ) ; /* 30 */
3771  }
3772 
3773 bool
3775  DRV_TMR_CLK_SOURCES clockSource ,
3776  TMR_PRESCALE prescale ) ;
3777 
3778 void
3780  uint32_t value ) ;
3781 
3782 uint32_t
3783  DRV_TMR1_CounterValueGet ( void ) ;
3784 
3785 void
3786  DRV_TMR1_CounterClear ( void ) ;
3787 
3788 TMR_PRESCALE
3789  DRV_TMR1_PrescalerGet ( void ) ;
3790 
3791 void
3793  uint32_t value ) ;
3794 
3795 uint32_t
3796  DRV_TMR1_PeriodValueGet ( void ) ;
3797 
3798 void
3799  DRV_TMR1_StopInIdleDisable ( void ) ;
3800 
3801 void
3802  DRV_TMR1_StopInIdleEnable ( void ) ;
3803 
3804 static inline void
3806  {
3807  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3808  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3809  fsk_60zqendz ( 24 ) ; /* 30 */
3810  }
3811 
3812 uint32_t
3813  DRV_TMR1_CounterFrequencyGet ( void ) ;
3814 
3817  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3818 // *****************************************************************************
3819 // *****************************************************************************
3820 // Section: Interface Headers for Instance 2 for the static driver
3821 // *****************************************************************************
3822 // *****************************************************************************
3823 
3824 void
3825  DRV_TMR2_Initialize ( void ) ;
3826 
3827 bool
3828  DRV_TMR2_Start ( void ) ;
3829 
3830 void
3831  DRV_TMR2_Stop ( void ) ;
3832 
3833 static inline void
3835  {
3836  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3837  DRV_TMR2_Stop () ;
3838  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3839  fsk_60zqendz ( 26 ) ; /* 30 */
3840  }
3841 
3842 static inline SYS_STATUS
3844 {
3845  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3846  /* Return the status as ready always */
3847  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3848  fsk_60zqendz ( 28 ) ; /* 30 */
3849  return
3850  SYS_STATUS_READY ;
3851 }
3852 
3853 static inline void
3854  DRV_TMR2_Open ( void )
3855  {
3856  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3857  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3858  fsk_60zqendz ( 30 ) ; /* 30 */
3859  }
3860 
3862  DRV_TMR2_ClientStatus ( void ) ;
3863 
3864 static inline DRV_TMR_OPERATION_MODE
3866 {
3867  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3868  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3869  fsk_60zqendz ( 32 ) ; /* 30 */
3870  return
3872 }
3873 
3874 static inline void
3876  {
3877  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3878  DRV_TMR2_Stop () ;
3879  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3880  fsk_60zqendz ( 34 ) ; /* 30 */
3881  }
3882 
3883 bool
3885  DRV_TMR_CLK_SOURCES clockSource ,
3886  TMR_PRESCALE prescale ) ;
3887 
3888 void
3890  uint32_t value ) ;
3891 
3892 uint32_t
3893  DRV_TMR2_CounterValueGet ( void ) ;
3894 
3895 void
3896  DRV_TMR2_CounterClear ( void ) ;
3897 
3898 TMR_PRESCALE
3899  DRV_TMR2_PrescalerGet ( void ) ;
3900 
3901 void
3903  uint32_t value ) ;
3904 
3905 uint32_t
3906  DRV_TMR2_PeriodValueGet ( void ) ;
3907 
3908 void
3909  DRV_TMR2_StopInIdleDisable ( void ) ;
3910 
3911 void
3912  DRV_TMR2_StopInIdleEnable ( void ) ;
3913 
3914 static inline void
3916  {
3917  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
3918  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
3919  fsk_60zqendz ( 36 ) ; /* 30 */
3920  }
3921 
3922 uint32_t
3923  DRV_TMR2_CounterFrequencyGet ( void ) ;
3924 
3927  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3928 // *****************************************************************************
3929 // *****************************************************************************
3930 // Section: Interface Headers for Instance 3 for the static driver
3931 // *****************************************************************************
3932 // *****************************************************************************
3933 
3934 void
3935  DRV_TMR3_Initialize ( void ) ;
3936 
3937 bool
3938  DRV_TMR3_Start ( void ) ;
3939 
3940 void
3941  DRV_TMR3_Stop ( void ) ;
3942 
3943 static inline void
3945  {
3946  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
3947  DRV_TMR3_Stop () ;
3948  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
3949  fsk_60zqendz ( 38 ) ; /* 30 */
3950  }
3951 
3952 static inline SYS_STATUS
3954 {
3955  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
3956  /* Return the status as ready always */
3957  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
3958  fsk_60zqendz ( 40 ) ; /* 30 */
3959  return
3960  SYS_STATUS_READY ;
3961 }
3962 
3963 static inline void
3964  DRV_TMR3_Open ( void )
3965  {
3966  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
3967  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
3968  fsk_60zqendz ( 42 ) ; /* 30 */
3969  }
3970 
3972  DRV_TMR3_ClientStatus ( void ) ;
3973 
3974 static inline DRV_TMR_OPERATION_MODE
3976 {
3977  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
3978  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
3979  fsk_60zqendz ( 44 ) ; /* 30 */
3980  return
3982 }
3983 
3984 static inline void
3986  {
3987  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
3988  DRV_TMR3_Stop () ;
3989  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
3990  fsk_60zqendz ( 46 ) ; /* 30 */
3991  }
3992 
3993 bool
3995  DRV_TMR_CLK_SOURCES clockSource ,
3996  TMR_PRESCALE prescale ) ;
3997 
3998 void
4000  uint32_t value ) ;
4001 
4002 uint32_t
4003  DRV_TMR3_CounterValueGet ( void ) ;
4004 
4005 void
4006  DRV_TMR3_CounterClear ( void ) ;
4007 
4008 TMR_PRESCALE
4009  DRV_TMR3_PrescalerGet ( void ) ;
4010 
4011 void
4013  uint32_t value ) ;
4014 
4015 uint32_t
4016  DRV_TMR3_PeriodValueGet ( void ) ;
4017 
4018 void
4019  DRV_TMR3_StopInIdleDisable ( void ) ;
4020 
4021 void
4022  DRV_TMR3_StopInIdleEnable ( void ) ;
4023 
4024 static inline void
4026  {
4027  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4028  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4029  fsk_60zqendz ( 48 ) ; /* 30 */
4030  }
4031 
4032 uint32_t
4033  DRV_TMR3_CounterFrequencyGet ( void ) ;
4034 
4037  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4038 // *****************************************************************************
4039 // *****************************************************************************
4040 // Section: Interface Headers for Instance 4 for the static driver
4041 // *****************************************************************************
4042 // *****************************************************************************
4043 
4044 void
4045  DRV_TMR4_Initialize ( void ) ;
4046 
4047 bool
4048  DRV_TMR4_Start ( void ) ;
4049 
4050 void
4051  DRV_TMR4_Stop ( void ) ;
4052 
4053 static inline void
4055  {
4056  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4057  DRV_TMR4_Stop () ;
4058  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4059  fsk_60zqendz ( 50 ) ; /* 30 */
4060  }
4061 
4062 static inline SYS_STATUS
4064 {
4065  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4066  /* Return the status as ready always */
4067  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4068  fsk_60zqendz ( 52 ) ; /* 30 */
4069  return
4070  SYS_STATUS_READY ;
4071 }
4072 
4073 static inline void
4074  DRV_TMR4_Open ( void )
4075  {
4076  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4077  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4078  fsk_60zqendz ( 54 ) ; /* 30 */
4079  }
4080 
4082  DRV_TMR4_ClientStatus ( void ) ;
4083 
4084 static inline DRV_TMR_OPERATION_MODE
4086 {
4087  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4088  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4089  fsk_60zqendz ( 56 ) ; /* 30 */
4090  return
4092 }
4093 
4094 static inline void
4096  {
4097  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4098  DRV_TMR4_Stop () ;
4099  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4100  fsk_60zqendz ( 58 ) ; /* 30 */
4101  }
4102 
4103 bool
4105  DRV_TMR_CLK_SOURCES clockSource ,
4106  TMR_PRESCALE prescale ) ;
4107 
4108 void
4110  uint32_t value ) ;
4111 
4112 uint32_t
4113  DRV_TMR4_CounterValueGet ( void ) ;
4114 
4115 void
4116  DRV_TMR4_CounterClear ( void ) ;
4117 
4118 TMR_PRESCALE
4119  DRV_TMR4_PrescalerGet ( void ) ;
4120 
4121 void
4123  uint32_t value ) ;
4124 
4125 uint32_t
4126  DRV_TMR4_PeriodValueGet ( void ) ;
4127 
4128 void
4129  DRV_TMR4_StopInIdleDisable ( void ) ;
4130 
4131 void
4132  DRV_TMR4_StopInIdleEnable ( void ) ;
4133 
4134 static inline void
4136  {
4137  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4138  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4139  fsk_60zqendz ( 60 ) ; /* 30 */
4140  }
4141 
4142 uint32_t
4143  DRV_TMR4_CounterFrequencyGet ( void ) ;
4144 
4147  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4148  // #ifndef _DRV_TMR_STATIC_H
4149 /*******************************************************************************
4150  End of File
4151 */
4152 
4153 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4154 /* CLOSE_FILE Include File */
4155 
4156 #include "peripheral/int/plib_int.h"
4157 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4158 /*******************************************************************************
4159  PMP Driver Interface Declarations for Static Single Instance Driver
4160  Company:
4161  Microchip Technology Inc.
4162  File Name:
4163  drv_pmp_static.h
4164  Summary:
4165  PMP driver interface declarations for the static single instance driver.
4166  Description:
4167  The PMP device driver provides a simple interface to manage the PMP
4168  modules on Microchip microcontrollers. This file defines the interface
4169  Declarations for the PMP driver.
4170 
4171  Remarks:
4172  Static interfaces incorporate the driver instance number within the names
4173  of the routines, eliminating the need for an object ID or object handle.
4174 
4175  Static single-open interfaces also eliminate the need for the open handle.
4176 *******************************************************************************/
4177 //DOM-IGNORE-BEGIN
4178 /*******************************************************************************
4179 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4180 Microchip licenses to you the right to use, modify, copy and distribute
4181 Software only when embedded on a Microchip microcontroller or digital signal
4182 controller that is integrated into your product or third party product
4183 (pursuant to the sublicense terms in the accompanying license agreement).
4184 You should refer to the license agreement accompanying this Software for
4185 additional information regarding your rights and obligations.
4186 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4187 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4188 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4189 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4190 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4191 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4192 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4193 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4194 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4195 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4196 *******************************************************************************/
4197 //DOM-IGNORE-END
4198 #ifndef _DRV_PMP_STATIC_H
4199 #define _DRV_PMP_STATIC_H
4200 #include "peripheral/pmp/plib_pmp.h"
4201 // *****************************************************************************
4202 // *****************************************************************************
4203 // Section: Interface Headers for Instance 0 for the static driver
4204 // *****************************************************************************
4205 // *****************************************************************************
4206 
4207 void
4208  DRV_PMP0_Initialize ( void ) ;
4209 
4210 void
4211  DRV_PMP0_ModeConfig ( void ) ;
4212 
4213 void
4215  PMP_DATA_WAIT_STATES dataWait ,
4216  PMP_STROBE_WAIT_STATES strobeWait ,
4217  PMP_DATA_HOLD_STATES dataHold ) ;
4218 
4219 uint8_t
4220  DRV_PMP0_Read ( void ) ;
4221 
4222 void
4223  DRV_PMP0_Write (
4224  uint8_t data ) ;
4225  // #ifndef _DRV_PMP_STATIC_H
4226 /*******************************************************************************
4227  End of File
4228 */
4229 
4230 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4231 /* CLOSE_FILE Include File */
4232 
4233 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4234 /*******************************************************************************
4235  USART Driver Interface Declarations for Static Single Instance Driver
4236  Company:
4237  Microchip Technology Inc.
4238  File Name:
4239  drv_usart_static.h
4240  Summary:
4241  USART driver interface declarations for the static single instance driver.
4242  Description:
4243  The USART device driver provides a simple interface to manage the USART
4244  modules on Microchip microcontrollers. This file defines the interface
4245  Declarations for the USART static driver.
4246  Remarks:
4247  Static interfaces incorporate the driver instance number within the names
4248  of the routines, eliminating the need for an object ID or object handle.
4249  Static single-open interfaces also eliminate the need for the open handle.
4250 *******************************************************************************/
4251 //DOM-IGNORE-BEGIN
4252 /*******************************************************************************
4253 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4254 Microchip licenses to you the right to use, modify, copy and distribute
4255 Software only when embedded on a Microchip microcontroller or digital signal
4256 controller that is integrated into your product or third party product
4257 (pursuant to the sublicense terms in the accompanying license agreement).
4258 You should refer to the license agreement accompanying this Software for
4259 additional information regarding your rights and obligations.
4260 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4261 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4262 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4263 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4264 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4265 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4266 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4267 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4268 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4269 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4270 *******************************************************************************/
4271 //DOM-IGNORE-END
4272 #ifndef _DRV_USART_STATIC_H
4273 #define _DRV_USART_STATIC_H
4274 // *****************************************************************************
4275 // *****************************************************************************
4276 // Section: Included Files
4277 // *****************************************************************************
4278 // *****************************************************************************
4279 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4280 /*******************************************************************************
4281  USART Driver Local Data Structures for static implementation
4282  Company:
4283  Microchip Technology Inc.
4284  File Name:
4285  drv_usart_static_local.h
4286  Summary:
4287  USART Driver Local Data Structures for static implementation
4288  Description:
4289  Driver Local Data Structures for static implementation
4290 *******************************************************************************/
4291 //DOM-IGNORE-BEGIN
4292 /*******************************************************************************
4293 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4294 Microchip licenses to you the right to use, modify, copy and distribute Software
4295 only when embedded on a Microchip microcontroller or digital signal controller
4296 that is integrated into your product or third party product (pursuant to the
4297 sublicense terms in the accompanying license agreement).
4298 You should refer to the license agreement accompanying this Software for
4299 additional information regarding your rights and obligations.
4300 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4301 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4302 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4303 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4304 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4305 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4306 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4307 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4308 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4309 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4310 *******************************************************************************/
4311 //DOM-IGNORE-END
4312 #ifndef _DRV_USART_STATIC_LOCAL_H
4313 #define _DRV_USART_STATIC_LOCAL_H
4314 // *****************************************************************************
4315 // *****************************************************************************
4316 // Section: Included Files
4317 // *****************************************************************************
4318 // *****************************************************************************
4319 #include <stdint.h>
4320 #include <stdbool.h>
4321 #include <stddef.h>
4322 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4323 /*******************************************************************************
4324  USART Driver Interface Header File
4325  Company:
4326  Microchip Technology Inc.
4327  File Name:
4328  drv_usart.h
4329  Summary:
4330  USART Driver Interface Header File
4331  Description:
4332  The USART device driver provides a simple interface to manage the USART or
4333  UART modules on Microchip microcontrollers. This file provides the
4334  interface definition for the USART driver.
4335 *******************************************************************************/
4336 //DOM-IGNORE-BEGIN
4337 /*******************************************************************************
4338 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4339 Microchip licenses to you the right to use, modify, copy and distribute
4340 Software only when embedded on a Microchip microcontroller or digital signal
4341 controller that is integrated into your product or third party product
4342 (pursuant to the sublicense terms in the accompanying license agreement).
4343 You should refer to the license agreement accompanying this Software for
4344 additional information regarding your rights and obligations.
4345 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4346 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4347 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4348 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4349 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4350 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4351 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4352 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4353 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4354 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4355 *******************************************************************************/
4356 //DOM-IGNORE-END
4357 #ifndef _DRV_USART_H
4358 #define _DRV_USART_H
4359 // *****************************************************************************
4360 // *****************************************************************************
4361 // Section: File includes
4362 // *****************************************************************************
4363 // *****************************************************************************
4364 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4365 /*******************************************************************************
4366  USART Driver Definitions Header File
4367  Company:
4368  Microchip Technology Inc.
4369  File Name:
4370  drv_usart_definitions.h
4371  Summary:
4372  USART Driver Definitions Header File
4373  Description:
4374  This file will provide enumerations and other dependencies needed by
4375  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4376 *******************************************************************************/
4377 //DOM-IGNORE-BEGIN
4378 /*******************************************************************************
4379 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4380 Microchip licenses to you the right to use, modify, copy and distribute
4381 Software only when embedded on a Microchip microcontroller or digital signal
4382 controller that is integrated into your product or third party product
4383 (pursuant to the sublicense terms in the accompanying license agreement).
4384 You should refer to the license agreement accompanying this Software for
4385 additional information regarding your rights and obligations.
4386 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4387 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4388 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4389 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4390 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4391 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4392 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4393 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4394 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4395 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4396 *******************************************************************************/
4397 //DOM-IGNORE-END
4398 #ifndef _DRV_USART_DEFINITIONS_H
4399 #define _DRV_USART_DEFINITIONS_H
4400 // *****************************************************************************
4401 // *****************************************************************************
4402 // Section: File includes
4403 // *****************************************************************************
4404 // *****************************************************************************
4405 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4406 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4407 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4408 /*******************************************************************************
4409  USART Peripheral Library Interface Header
4410  Company:
4411  Microchip Technology Inc.
4412  File Name:
4413  plib_usart.h
4414  Summary:
4415  USART Peripheral Library interface header.
4416  Description:
4417  This header file contains the function prototypes and definitions of
4418  the data types and constants that make up the interface to the USART
4419  Peripheral Library for all families of Microchip microcontrollers. The
4420  functions in this file are common to the USART module.
4421  *******************************************************************************/
4422 // DOM-IGNORE-BEGIN
4423 /*******************************************************************************
4424 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4425 Microchip licenses to you the right to use, modify, copy and distribute
4426 Software only when embedded on a Microchip microcontroller or digital signal
4427 controller that is integrated into your product or third party product
4428 (pursuant to the sublicense terms in the accompanying license agreement).
4429 You should refer to the license agreement accompanying this Software for
4430 additional information regarding your rights and obligations.
4431 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4432 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4433 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4434 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4435 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4436 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4437 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4438 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4439 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4440 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4441  *******************************************************************************/
4442 // DOM-IGNORE-END
4443 #ifndef _PLIB_USART_H
4444 #define _PLIB_USART_H
4445 // DOM-IGNORE-BEGIN
4446 // DOM-IGNORE-END
4447 // ****************************************************************************
4448 // ****************************************************************************
4449 // Section: Included Files
4450 // ****************************************************************************
4451 // ****************************************************************************
4452 /* This section lists the other files that are included in this file.
4453 */
4454 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4455 /*******************************************************************************
4456  Processor Selector File for the USART
4457  Company:
4458  Microchip Technology Incorporated
4459  File Name:
4460  processor.h
4461  Summary:
4462  Selects the appropriate header for the part family
4463  Description:
4464  This file selects the appropriate header for the part family
4465  *******************************************************************************/
4466 // DOM-IGNORE-BEGIN
4467 /*******************************************************************************
4468 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4469 Microchip licenses to you the right to use, modify, copy and distribute
4470 Software only when embedded on a Microchip microcontroller or digital signal
4471 controller that is integrated into your product or third party product
4472 (pursuant to the sublicense terms in the accompanying license agreement).
4473 You should refer to the license agreement accompanying this Software for
4474 additional information regarding your rights and obligations.
4475 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4476 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4477 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4478 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4479 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4480 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4481 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4482 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4483 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4484 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4485  *******************************************************************************/
4486 // DOM-IGNORE-END
4487 #ifndef _USART_PROCESSOR_H
4488 #define _USART_PROCESSOR_H
4489 // *****************************************************************************
4490 // *****************************************************************************
4491 // Section: Included Files
4492 // *****************************************************************************
4493 // *****************************************************************************
4494 /* This section lists the other files that are included in this file.
4495  */
4496 #include <stdint.h>
4497 #include <stdbool.h>
4498 #error "No Processor Family specified"
4499  //
4500  // _USART_PROCESSOR_H
4501 /*******************************************************************************
4502  End of File
4503  */
4504 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4505 /* CLOSE_FILE Include File */
4506 
4507 // ****************************************************************************
4508 // ****************************************************************************
4509 // Section: USART Peripheral Library Interface Functions
4510 // ****************************************************************************
4511 // ****************************************************************************
4512 //******************************************************************************
4513 /* Function:
4514  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4515  Summary:
4516  Enables the USART module to continue to operate when an overflow error
4517  condition has occurred.
4518  Description:
4519  This function enables the USART module to continue to operate when an
4520  overflow error condition has occurred.
4521  This operation is atomic.
4522  Precondition:
4523  None.
4524  Parameters:
4525  index - Identifier for the device instance to be configured
4526  Returns:
4527  None.
4528  Example:
4529  <code>
4530 #define MY_USART_INSTANCE USART_ID_1
4531  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4532  </code>
4533  Remarks:
4534  This feature may not be available on all devices. Please refer to the
4535  specific device data sheet to determine availability or use
4536  PLIB_USART_ExistsRunInOverflow in your application to determine
4537  whether this feature is available.
4538 */
4539 
4540 void
4542  USART_MODULE_ID index ) ;
4543 //******************************************************************************
4544 /* Function:
4545  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4546  Summary:
4547  Disables the Run in overflow condition mode.
4548  Description:
4549  This function disables the USART module from accepting new data when an overflow
4550  error condition is detected.
4551  This operation is atomic.
4552  Precondition:
4553  None.
4554  Parameters:
4555  index - Identifier for the device instance to be configured
4556  Returns:
4557  None.
4558  Example:
4559  <code>
4560 #define MY_USART_INSTANCE USART_ID_1
4561  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4562  </code>
4563  Remarks:
4564  This feature may not be available on all devices. Please refer to the
4565  specific device data sheet to determine availability or use
4566  PLIB_USART_ExistsRunInOverflow in your application to determine
4567  whether this feature is available.
4568 */
4569 
4570 void
4572  USART_MODULE_ID index ) ;
4573 //******************************************************************************
4574 /* Function:
4575  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4576  Summary:
4577  Gets the status of the Run in Overflow condition.
4578  Description:
4579  This function indicates if the USART module has been enabled to run in
4580  an overflow condition.
4581  This operation is atomic.
4582  Precondition:
4583  None.
4584  Parameters:
4585  index - Identifier for the device instance
4586  Returns:
4587  - true - Run in overflow condition is enabled
4588  - false - Run in overflow condition is disabled
4589  Example:
4590  <code>
4591 #define MY_USART_INSTANCE USART_ID_1
4592  bool status;
4593  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4594  </code>
4595  Remarks:
4596  This feature may not be available on all devices. Please refer to the
4597  specific device data sheet to determine availability or use
4598  PLIB_USART_ExistsRunInOverflow in your application to determine
4599  whether this feature is available.
4600 */
4601 
4602 bool
4604  USART_MODULE_ID index ) ;
4605 //******************************************************************************
4606 /* Function:
4607  void PLIB_USART_BRGClockSourceSelect
4608  (
4609  USART_MODULE_ID index,
4610  USART_BRG_CLOCK_SOURCE brgClockSource
4611  )
4612  Summary:
4613  Configures the BRG clock source of the USART module.
4614  Description:
4615  This function configures the BRG Clock source of the USART. Refer to
4616  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4617  Precondition:
4618  None.
4619  Parameters:
4620  index - Identifier for the device instance to be configured
4621  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4622  Returns:
4623  None.
4624  Example:
4625  <code>
4626 #define MY_USART_INSTANCE USART_ID_1
4627  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4628  </code>
4629  Remarks:
4630  This feature may not be available on all devices. Please refer to the
4631  specific device data sheet to determine availability or use
4632  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4633  whether this feature is available.
4634 */
4635 
4636 void
4638  USART_MODULE_ID index ,
4639  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4640 //******************************************************************************
4641 /* Function:
4642  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4643  Summary:
4644  Gets the BRG clock source of the USART module.
4645  Description:
4646  This function returns the BRG Clock source of the USART. Refer to
4647  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4648  This operation is atomic.
4649  Precondition:
4650  None.
4651  Parameters:
4652  index - Identifier for the device instance
4653  Returns:
4654  One of the possible values of USART_BRG_CLOCK_SOURCE
4655  Example:
4656  <code>
4657 #define MY_USART_INSTANCE USART_ID_1
4658  USART_BRG_CLOCK_SOURCE brgClockSource;
4659  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4660  </code>
4661  Remarks:
4662  This feature may not be available on all devices. Please refer to the
4663  specific device data sheet to determine availability or use
4664  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4665  whether this feature is available.
4666 */
4667 
4668 USART_BRG_CLOCK_SOURCE
4670  USART_MODULE_ID index ) ;
4671 //******************************************************************************
4672 /* Function:
4673  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4674  Summary:
4675  Returns the USART module's running status.
4676  Description:
4677  This function checks if the USART module status is busy. The following
4678  functions should not be used when the module status is busy:
4679  - PLIB_USART_LineControlModeSelect
4680  - PLIB_USART_BaudRateHighSet
4681  - PLIB_USART_BaudRateHighEnable
4682  - PLIB_USART_BaudRateHighDisable
4683  - PLIB_USART_ReceiverIdleStateLowEnable
4684  - PLIB_USART_ReceiverIdleStateLowDisable
4685  - PLIB_USART_BaudRateAutoDetectEnable
4686  - PLIB_USART_LoopbackEnable
4687  - PLIB_USART_LoopbackDisable
4688  - PLIB_USART_WakeOnStartEnable
4689  - PLIB_USART_WakeOnStartDisable
4690  - PLIB_USART_OperationModeSelect
4691  - PLIB_USART_HandshakeModeSelect
4692  - PLIB_USART_IrDAEnable
4693  - PLIB_USART_IrDADisable
4694  - PLIB_USART_StopInIdleEnable
4695  - PLIB_USART_StopInIdleDisable
4696  - PLIB_USART_RunInOverflowEnable
4697  - PLIB_USART_RunInOverflowDisable
4698  - PLIB_USART_BRGClockSourceSelect
4699  - PLIB_USART_RunInSleepModeEnable
4700  - PLIB_USART_RunInSleepModeDisable
4701  This operation is atomic.
4702  Precondition:
4703  None.
4704  Parameters:
4705  index - Identifier for the device instance
4706  Returns:
4707  - true - USART module is busy
4708  - false - USART module is idle
4709  Example:
4710  <code>
4711 #define MY_USART_INSTANCE USART_ID_1
4712  bool moduleStatus;
4713  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4714  </code>
4715  Remarks:
4716  This feature may not be available on all devices. Please refer to the
4717  specific device data sheet to determine availability or use
4718  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4719  whether this feature is available.
4720 */
4721 
4722 bool
4724  USART_MODULE_ID index ) ;
4725 //******************************************************************************
4726 /* Function:
4727  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4728  Summary:
4729  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4730  Description:
4731  This function enables the USART module's BRG clock to continue operation when
4732  the device enters the Sleep mode.
4733  This operation is atomic.
4734  Precondition:
4735  None.
4736  Parameters:
4737  index - Identifier for the device instance to be configured
4738  Returns:
4739  None.
4740  Example:
4741  <code>
4742 #define MY_USART_INSTANCE USART_ID_1
4743  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4744  </code>
4745  Remarks:
4746  This feature may not be available on all devices. Please refer to the
4747  specific device data sheet to determine availability or use
4748  PLIB_USART_ExistsRunInSleepMode in your application to determine
4749  whether this feature is available.
4750 */
4751 
4752 void
4754  USART_MODULE_ID index ) ;
4755 //******************************************************************************
4756 /* Function:
4757  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4758  Summary:
4759  Turns off the USART module's BRG clock during Sleep mode.
4760  Description:
4761  This function turns off the USART module's BRG clock during Sleep mode.
4762  This operation is atomic.
4763  Precondition:
4764  None.
4765  Parameters:
4766  index - Identifier for the device instance to be configured
4767  Returns:
4768  None.
4769  Example:
4770  <code>
4771 #define MY_USART_INSTANCE USART_ID_1
4772  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4773  </code>
4774  Remarks:
4775  This feature may not be available on all devices. Please refer to the
4776  specific device data sheet to determine availability or use
4777  PLIB_USART_ExistsRunInSleepMode in your application to determine
4778  whether this feature is available.
4779 */
4780 
4781 void
4783  USART_MODULE_ID index ) ;
4784 //******************************************************************************
4785 /* Function:
4786  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4787  Summary:
4788  Gets the status of Run in Sleep mode.
4789  Description:
4790  This function indicates if the USART module has been enabled to run in
4791  Sleep mode.
4792  This operation is atomic.
4793  Precondition:
4794  None.
4795  Parameters:
4796  index - Identifier for the device instance
4797  Returns:
4798  - true - Run in Sleep mode is enabled
4799  - false - Run in Sleep mode is disabled
4800  Example:
4801  <code>
4802 #define MY_USART_INSTANCE USART_ID_1
4803  bool status;
4804  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4805  </code>
4806  Remarks:
4807  This feature may not be available on all devices. Please refer to the
4808  specific device data sheet to determine availability or use
4809  PLIB_USART_ExistsRunInSleepMode in your application to determine
4810  whether this feature is available.
4811 */
4812 
4813 bool
4815  USART_MODULE_ID index ) ;
4816 //******************************************************************************
4817 /* Function:
4818  void PLIB_USART_Enable ( USART_MODULE_ID index )
4819  Summary:
4820  Enables the specific USART module.
4821  Description:
4822  This function enables the specific USART module.
4823  This operation is atomic.
4824  Precondition:
4825  None.
4826  Parameters:
4827  index - Identifier for the device instance to be configured
4828  Returns:
4829  None.
4830  Example:
4831  <code>
4832 #define MY_USART_INSTANCE USART_ID_1
4833  PLIB_USART_Enable(MY_USART_INSTANCE);
4834  </code>
4835  Remarks:
4836  By calling this function, the USART pins are controlled by the USART
4837  module.
4838  This feature may not be available on all devices. Please refer to the
4839  specific device data sheet to determine availability or use
4840  PLIB_USART_ExistsEnable in your application to determine whether
4841  this feature is available.
4842 */
4843 
4844 void
4846  USART_MODULE_ID index ) ;
4847 //******************************************************************************
4848 /* Function:
4849  void PLIB_USART_Disable ( USART_MODULE_ID index )
4850  Summary:
4851  Disables the specific USART module
4852  Description:
4853  This function disables the specific USART module.
4854  This operation is atomic.
4855  Precondition:
4856  None.
4857  Parameters:
4858  index - Identifier for the device instance to be configured
4859  Returns:
4860  None.
4861  Example:
4862  <code>
4863 #define MY_USART_INSTANCE USART_ID_1
4864  PLIB_USART_Disable(MY_USART_INSTANCE);
4865  </code>
4866  Remarks:
4867  The default state after any reset for a USART module is the disable state.
4868  If the USART is disabled, all of the related pins are in control of the
4869  general purpose I/O logic.
4870 
4871  Disabling the USART module resets the buffers to empty states. Any data
4872  characters in the buffers are lost and the baud rate is reset. All error
4873  and status bits are also reset.
4874 
4875  Disabling the USART while the USART is active, will abort all pending
4876  transmissions and receptions. Re-enabling the USART will restart the
4877  module in the same configuration.
4878 
4879  When disabled, the USART power consumption is minimal.
4880  This feature may not be available on all devices. Please refer to the
4881  specific device data sheet to determine availability or use
4882  PLIB_USART_ExistsEnable in your application to determine whether
4883  this feature is available.
4884 */
4885 
4886 void
4888  USART_MODULE_ID index ) ;
4889 //******************************************************************************
4890 /* Function:
4891  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4892  Summary:
4893  Enables the specific USART module transmitter.
4894  Description:
4895  This function enables the specific USART module transmitter.
4896  This operation is atomic.
4897  Precondition:
4898  The USART module should be enabled using the function PLIB_USART_Enable
4899  before this function is called.
4900  Parameters:
4901  index - Identifier for the device instance to be configured
4902  Returns:
4903  None.
4904  Example:
4905  <code>
4906 #define MY_USART_INSTANCE USART_ID_1
4907  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4908  </code>
4909  Remarks:
4910  The transmitter should not be enabled until the USART is enabled.
4911  The transmissions will not be enabled otherwise.
4912 
4913  This feature may not be available on all devices. Please refer to the
4914  specific device data sheet to determine availability or use
4915  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4916  this feature is available.
4917 */
4918 
4919 void
4921  USART_MODULE_ID index ) ;
4922 //******************************************************************************
4923 /* Function:
4924  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
4925  Summary:
4926  Disables the specific USART module transmitter.
4927  Description:
4928  This function disables the specific USART module transmitter.
4929  This operation is atomic.
4930  Precondition:
4931  None.
4932  Parameters:
4933  index - Identifier for the device instance to be configured
4934  Returns:
4935  None.
4936  Example:
4937  <code>
4938 #define MY_USART_INSTANCE USART_ID_1
4939  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
4940  </code>
4941  Remarks:
4942  Disabling the transmitter during a transmission will cause the
4943  transmission to be aborted.
4944 
4945  This feature may not be available on all devices. Please refer to the
4946  specific device data sheet to determine availability or use
4947  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4948  this feature is available.
4949 */
4950 
4951 void
4953  USART_MODULE_ID index ) ;
4954 //******************************************************************************
4955 /* Function:
4956  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
4957  uint32_t baudRate );
4958  Summary:
4959  Sets the baud rate to the desired value.
4960  Description:
4961  This function sets the baud rate to the desired value.
4962  Precondition:
4963  None.
4964  Parameters:
4965  index - Identifier for the device instance to be configured
4966  baudRate - Baud Rate Value
4967  clockFrequency - Clock Frequency
4968  Returns:
4969  None.
4970  Example:
4971  <code>
4972 #define MY_USART_INSTANCE USART_ID_1
4973  uint32_t baudRateValue ;
4974  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4975  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
4976  </code>
4977  Remarks:
4978  Setting a new baud rate value causes the baud rate timer to reset.
4979  This ensures that the baud rate timer does not have to overflow before
4980  outputting the new baud rate.
4981 
4982  If the system clock is changed during an active receive operation, a
4983  receiver error or data loss may result. To avoid this issue verify that
4984  no receptions are in progress before changing the system clock.
4985 
4986  This feature may not be available on all devices. Please refer to the
4987  specific device data sheet to determine availability or use
4988  PLIB_USART_ExistsBaudRate in your application to determine whether
4989  this feature is available.
4990 */
4991 
4992 void
4994  USART_MODULE_ID index ,
4995  uint32_t clockFrequency ,
4996  uint32_t baudRate ) ;
4997 //******************************************************************************
4998 /* Function:
4999  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5000  uint32_t clockFrequency, uint32_t baudRate );
5001  Summary:
5002  Sets the baud rate to the desired value.
5003  Description:
5004  This function sets the baud rate to the desired value.
5005  Precondition:
5006  None.
5007  Parameters:
5008  index - Identifier for the device instance to be configured
5009  baudRate - Baud Rate Value, it is the baud rate value
5010  clockFrequency - Clock Frequency
5011  Returns:
5012  None.
5013  Example:
5014  <code>
5015 #define MY_USART_INSTANCE USART_ID_1
5016  uint32_t baudRateValue ;
5017  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5018  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5019  </code>
5020  Remarks:
5021  Setting a new baud rate value causes the baud rate timer to reset.
5022  This ensures that the baud rate timer does not have to overflow before
5023  outputting the new baud rate.
5024 
5025  If the system clock is changed during an active receive operation, a
5026  receiver error or data loss may result. To avoid this issue verify that
5027  no receptions are in progress before changing the system clock.
5028 
5029  This feature may not be available on all devices. Please refer to the
5030  specific device data sheet to determine availability or use
5031  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5032  this feature is available.
5033 */
5034 
5035 void
5037  USART_MODULE_ID index ,
5038  uint32_t clockFrequency ,
5039  uint32_t baudRate ) ;
5040 //******************************************************************************
5041 /* Function:
5042  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5043  int32_t clockFrequency );
5044  Summary:
5045  Gets the baud rate current in use.
5046  Description:
5047  This function gets the baud rate that is currently in use. The clock frequency
5048  needs to be passed to the function.
5049  Conditions:
5050  None.
5051  Input:
5052  index - Identifier for the device instance to be configured
5053  clockFrequency - Clock Frequency
5054  Returns:
5055  - BaudRate - Baud rate value
5056  Example:
5057  <code>
5058 #define MY_USART_INSTANCE USART_ID_1
5059  uint32_t baudRate ;
5060  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5061  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5062  </code>
5063  Remarks:
5064  This feature may not be available on all devices. Please refer to the
5065  specific device data sheet to determine availability or use
5066  PLIB_USART_ExistsBaudRate in your application to determine whether
5067  this feature is available.
5068 */
5069 
5070 uint32_t
5072  USART_MODULE_ID index ,
5073  int32_t clockFrequency ) ;
5074 //******************************************************************************
5075 /* Function:
5076  void PLIB_USART_AddressSet
5077  (
5078  USART_MODULE_ID index,
5079  uint8_t address
5080  )
5081  Summary:
5082  Sets the address for the Address Detect mode.
5083  Description:
5084  This function sets the address for the Address Detect mode.
5085  This operation is atomic.
5086  Precondition:
5087  None.
5088  Parameters:
5089  index - Identifier for the device instance to be configured
5090  address - Address
5091  Returns:
5092  None.
5093  Example:
5094  <code>
5095 #define MY_USART_INSTANCE USART_ID_1
5096  uint8_t address = 0x02;
5097  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5098  </code>
5099  Remarks:
5100  This feature may not be available on all devices. Please refer to the
5101  specific device data sheet to determine availability or use
5102  PLIB_USART_ExistsReceiverAddress in your application to determine
5103  whether this feature is available.
5104 */
5105 
5106 void
5108  USART_MODULE_ID index ,
5109  uint8_t address ) ;
5110 //******************************************************************************
5111 /* Function:
5112  uint8_t PLIB_USART_AddressGet
5113  (
5114  USART_MODULE_ID index
5115  )
5116  Summary:
5117  Gets the address for the Address Detect mode.
5118  Description:
5119  This function returns the address value being used for the Address
5120  Detect mode.
5121  This operation is atomic.
5122  Precondition:
5123  None.
5124  Parameters:
5125  index - Identifier for the device instance
5126  Returns:
5127  - address - The address being used
5128  Example:
5129  <code>
5130 #define MY_USART_INSTANCE USART_ID_1
5131  uint8_t address = 0;
5132  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5133  </code>
5134  Remarks:
5135  This feature may not be available on all devices. Please refer to the
5136  specific device data sheet to determine availability or use
5137  PLIB_USART_ExistsReceiverAddress in your application to determine
5138  whether this feature is available.
5139 */
5140 
5141 uint8_t
5143  USART_MODULE_ID index ) ;
5144 //******************************************************************************
5145 /* Function:
5146  void PLIB_USART_AddressMaskSet
5147  (
5148  USART_MODULE_ID index,
5149  uint8_t mask
5150  )
5151  Summary:
5152  Sets the address mask for the Address Detect mode.
5153  Description:
5154  This function sets the address mask for the Address Detect mode.
5155  This operation is atomic.
5156  Precondition:
5157  None.
5158  Parameters:
5159  index - Identifier for the device instance to be configured
5160  mask - Address match mask bits
5161  Returns:
5162  None.
5163  Example:
5164  <code>
5165 #define MY_USART_INSTANCE USART_ID_1
5166  uint8_t mask = 0x0F;
5167  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5168  </code>
5169  Remarks:
5170  This feature may not be available on all devices. Please refer to the
5171  specific device data sheet to determine availability or use
5172  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5173  whether this feature is available.
5174 */
5175 
5176 void
5178  USART_MODULE_ID index ,
5179  uint8_t mask ) ;
5180 //******************************************************************************
5181 /* Function:
5182  uint8_t PLIB_USART_AddressMaskGet
5183  (
5184  USART_MODULE_ID index
5185  )
5186  Summary:
5187  Gets the address mask for the Address Detect mode.
5188  Description:
5189  This function returns the address mask value being used for the Address
5190  Detect mode.
5191  This operation is atomic.
5192  Precondition:
5193  None.
5194  Parameters:
5195  index - Identifier for the device instance to be configured
5196  Returns:
5197  - mask - Address mask being used
5198  Example:
5199  <code>
5200 #define MY_USART_INSTANCE USART_ID_1
5201  uint8_t mask = 0;
5202  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5203  </code>
5204  Remarks:
5205  This feature may not be available on all devices. Please refer to the
5206  specific device data sheet to determine availability or use
5207  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5208  whether this feature is available.
5209 */
5210 
5211 uint8_t
5213  USART_MODULE_ID index ) ;
5214 //******************************************************************************
5215 /* Function:
5216  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5217  Summary:
5218  Enables the Address Detect mode.
5219  Description:
5220  This function enables the Address Detect mode. If it is enabled, and the
5221  device is addressed, disable the Address Detect mode to continue receiving
5222  bytes.
5223  This operation is atomic.
5224  Precondition:
5225  None.
5226  Parameters:
5227  index - Identifier for the device instance to be configured
5228  Returns:
5229  None.
5230  Example:
5231  <code>
5232 #define MY_USART_INSTANCE USART_ID_1
5233  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5234  </code>
5235  Remarks:
5236  If 9 data bits are not selected, this bit has no effect.
5237  This feature may not be available on all devices. Please refer to the
5238  specific device data sheet to determine availability or use
5239  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5240  this feature is available.
5241 */
5242 
5243 void
5245  USART_MODULE_ID index ) ;
5246 //******************************************************************************
5247 /* Function:
5248  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5249  Summary:
5250  Enables the Address Detect mode.
5251  Description:
5252  This function disables the Address Detect mode. If it is enabled, and the
5253  device is addressed, disable the Address Detect mode to continue receiving
5254  bytes.
5255  This operation is atomic.
5256  Precondition:
5257  None.
5258  Parameters:
5259  index - Identifier for the device instance to be configured
5260  Returns:
5261  None.
5262  Example:
5263  <code>
5264 #define MY_USART_INSTANCE USART_ID_1
5265  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5266  </code>
5267  Remarks:
5268  All bytes are received, and the 9th bit can be used as the parity bit.
5269  By default, the address detect is disabled.
5270 
5271  This feature may not be available on all devices. Please refer to the
5272  specific device data sheet to determine availability or use
5273  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5274  this feature is available.
5275 */
5276 
5277 void
5279  USART_MODULE_ID index ) ;
5280 //******************************************************************************
5281 /* Function:
5282  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5283  Summary:
5284  Gets the state of the automatic baud detection.
5285  Description:
5286  This function gets the state of the automatic baud detection and returns a '0'
5287  if the baud rate auto detection is complete.
5288  This operation is atomic.
5289  Precondition:
5290  None.
5291  Parameters:
5292  index - Identifier for the device instance to be configured
5293  Returns:
5294  - true - Baud rate detection is not complete
5295  - false - Baud rate detection is complete
5296  Example:
5297  <code>
5298 #define MY_USART_INSTANCE USART_ID_1
5299  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5300  // Wait until the baud rate is detected.
5301  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5302  </code>
5303  Remarks:
5304  This feature may not be available on all devices. Please refer to the
5305  specific device data sheet to determine availability or use
5306  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5307  this feature is available.
5308 */
5309 
5310 bool
5312  USART_MODULE_ID index ) ;
5313 //******************************************************************************
5314 /* Function:
5315  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5316  Summary:
5317  Enables baud rate measurement on the next character, which requires reception
5318  of the Sync character.
5319  Description:
5320  This function enables the baud rate measurement on the next character,
5321  which requires reception of the Sync character.
5322  This operation is atomic.
5323  Precondition:
5324  None.
5325  Parameters:
5326  index - Identifier for the device instance to be configured
5327  Returns:
5328  None.
5329  Example:
5330  <code>
5331 #define MY_USART_INSTANCE USART_ID_1
5332  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5333  // Wait until the baud rate is detected.
5334  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5335  </code>
5336  Remarks:
5337  This feature may not be available on all devices. Please refer to the
5338  specific device data sheet to determine availability or use
5339  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5340  this feature is available.
5341 */
5342 
5343 void
5345  USART_MODULE_ID index ) ;
5346 //******************************************************************************
5347 /* Function:
5348  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5349  Summary:
5350  Data to be transmitted in the Byte mode.
5351  Description:
5352  The data is transmitted in the Byte mode for the specified USART module.
5353  This operation is atomic.
5354  Precondition:
5355  None.
5356  Parameters:
5357  index - Identifier for the device instance to be configured
5358  data - Data to be transmitted.
5359  Returns:
5360  None.
5361  Example:
5362  <code>
5363 #define MY_USART_INSTANCE USART_ID_1
5364  uint8_t data = 'a';
5365  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5366  {
5367  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5368  }
5369  </code>
5370  Remarks:
5371  This feature may not be available on all devices. Please refer to the
5372  specific device data sheet to determine availability or use
5373  PLIB_USART_ExistsTransmitter in your application to determine whether
5374  this feature is available.
5375 */
5376 
5377 void
5379  USART_MODULE_ID index ,
5380  int8_t data ) ;
5381 //******************************************************************************
5382 /* Function:
5383  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5384  Summary:
5385  Data to be received in the Byte mode.
5386  Description:
5387  The data to be received in Byte mode from the specified USART module.
5388  This operation is atomic.
5389  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5390  PLIB_USART_ReceiverParityErrorHasOccurred and
5391  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5392  Precondition:
5393  None.
5394  Parameters:
5395  index - Identifier for the device instance to be configured
5396  Returns:
5397  - data - Data to be received
5398  Example:
5399  <code>
5400 #define MY_USART_INSTANCE USART_ID_1
5401  bool isError;
5402  uint8_t mydata;
5403  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5404  {
5405  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5406  }
5407  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5408  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5409  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5410  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5411  {
5412  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5413  }
5414  </code>
5415  Remarks:
5416  This feature may not be available on all devices. Please refer to the
5417  specific device data sheet to determine availability or use
5418  PLIB_USART_ExistsReceiver in your application to determine whether
5419  this feature is available.
5420 */
5421 
5422 int8_t
5424  USART_MODULE_ID index ) ;
5425 //******************************************************************************
5426 /* Function:
5427  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5428  Summary:
5429  Data to be received in the byte mode with the 9th bit.
5430  Description:
5431  The data to be received in Byte mode from the specified USART module.
5432  with the 9th bit.
5433  This operation is atomic.
5434  Precondition:
5435  None.
5436  Parameters:
5437  index - Identifier for the device instance to be configured
5438  Returns:
5439  - data - Data to be received
5440  Example:
5441  <code>
5442 #define MY_USART_INSTANCE USART_ID_1
5443  uint16_t mydata;
5444  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5445  {
5446  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5447  }
5448  </code>
5449  Remarks:
5450  This feature may not be available on all devices. Please refer to the
5451  specific device data sheet to determine availability or use
5452  PLIB_USART_ExistsReceiver9Bits in your application to determine
5453  whether this feature is available.
5454 */
5455 
5456 int16_t
5458  USART_MODULE_ID index ) ;
5459 //******************************************************************************
5460 /* Function:
5461  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5462  Summary:
5463  Checks and return if the data received is an address.
5464  Description:
5465  Checks and return if the data received is an address. The address has
5466  the 9th bit set. If data received has the 9th bit set, the function returns true;
5467  otherwise, the function returns false.
5468  This operation is atomic.
5469  Precondition:
5470  The USART module should be configured to use the 9 data bits.
5471  Parameters:
5472  index - Identifier for the device instance to be configured
5473  Returns:
5474  - true - if the data received has the 9th bit set
5475  - false - if the address received has the 9th bit cleared
5476  Example:
5477  <code>
5478 #define MY_USART_INSTANCE USART_ID_1
5479  int8_t address;
5480  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5481  {
5482  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5483  }
5484  </code>
5485  Remarks:
5486  This feature may not be available on all devices. Please refer to the
5487  specific device data sheet to determine availability or use
5488  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5489  this feature is available.
5490 */
5491 
5492 bool
5494  USART_MODULE_ID index ) ;
5495 //******************************************************************************
5496 /* Function:
5497  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5498  int8_t data, bool 9thBit )
5499  Summary:
5500  Data to be transmitted in the byte mode with the 9th bit.
5501  Description:
5502  The data is transmitted in the byte mode for the specified USART module,
5503  with 9th bit.
5504  This operation is atomic.
5505  Precondition:
5506  The USART module should be configured to use the 9 data bits.
5507  Parameters:
5508  index - Identifier for the device instance to be configured
5509  data - Data to be transmitted.
5510  9thBit - 9th bit of the data to be transmitted.
5511  Returns:
5512  None.
5513  Example:
5514  <code>
5515 #define MY_USART_INSTANCE USART_ID_1
5516  uint8_t data = 'a';
5517  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5518  {
5519  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5520  }
5521  </code>
5522  Remarks:
5523  This feature may not be available on all devices. Please refer to the
5524  specific device data sheet to determine availability or use
5525  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5526  this feature is available.
5527 */
5528 
5529 void
5531  USART_MODULE_ID index ,
5532  int8_t data ,
5533  bool Bit9th ) ;
5534 //******************************************************************************
5535 /* Function:
5536  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5537  Summary:
5538  Transmits the break character.
5539  Description:
5540  This function transmits the break character.
5541  This operation is atomic.
5542  Precondition:
5543  The application should wait for the transmitter to be idle, before calling
5544  this function.
5545  Parameters:
5546  index - Identifier for the device instance to be configured
5547  Returns:
5548  None.
5549  Example:
5550  <code>
5551 #define MY_USART_INSTANCE USART_ID_1
5552  // Wait for the Transmit buffer to be empty.
5553  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5554  // Transmit the break character.
5555  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5556  // wait for the break transmission to complete
5557  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5558  </code>
5559  Remarks:
5560  After the break has been transmitted, the application can start
5561  transmitting next bytes.
5562 
5563  This feature may not be available on all devices. Please refer to the
5564  specific device data sheet to determine availability or use
5565  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5566  this feature is available.
5567 */
5568 
5569 void
5571  USART_MODULE_ID index ) ;
5572 //******************************************************************************
5573 /* Function:
5574  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5575  Summary:
5576  Returns the status of the break transmission
5577  Description:
5578  The function returns the status of the break transmission.
5579  This operation is atomic.
5580  Precondition:
5581  None.
5582  Parameters:
5583  index - Identifier for the device instance to be configured
5584  Returns:
5585  - true - Transmit break on the next transmission
5586  - false - Break transmission completed or not started
5587  Example:
5588  <code>
5589 #define MY_USART_INSTANCE USART_ID_1
5590  // Wait for the Transmit buffer to be empty.
5591  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5592  // Transmit the break character.
5593  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5594  // wait for the break transmission to complete
5595  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5596  </code>
5597  Remarks:
5598  After the break has been transmitted, the application can start
5599  transmitting next bytes.
5600 
5601  This feature may not be available on all devices. Please refer to the
5602  specific device data sheet to determine availability or use
5603  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5604  this feature is available.
5605 */
5606 
5607 bool
5609  USART_MODULE_ID index ) ;
5610 //******************************************************************************
5611 /* Function:
5612  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5613  Summary:
5614  Identifies if the receive data is available for the specified USART module.
5615  Description:
5616  This function identifies if the receive data is available for the specified
5617  USART module.
5618  This operation is atomic.
5619  Precondition:
5620  None.
5621  Parameters:
5622  index - Identifier for the device instance to be configured
5623  Returns:
5624  - true - The data is available
5625  - false - The data is not available
5626  Example:
5627  <code>
5628 #define MY_USART_INSTANCE USART_ID_1
5629  int8_t mydata;
5630  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5631  {
5632  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5633  }
5634  </code>
5635  Remarks:
5636  This feature may not be available on all devices. Please refer to the
5637  specific device data sheet to determine availability or use
5638  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5639  whether this feature is available.
5640 */
5641 
5642 bool
5644  USART_MODULE_ID index ) ;
5645 //******************************************************************************
5646 /* Function:
5647  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5648  Summary:
5649  Clears a USART vverrun error.
5650  Description:
5651  This function clears an overrun error. Clearing the error, resets the receive buffer.
5652  This operation is atomic.
5653  Precondition:
5654  None.
5655  Parameters:
5656  index - Identifier for the device instance to be configured
5657  Returns:
5658  None.
5659  Example:
5660  <code>
5661 #define MY_USART_INSTANCE USART_ID_1
5662  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5663  {
5664  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5665  }
5666  </code>
5667  Remarks:
5668  WARNING: Calling this API will clear all of the previously received data.
5669 
5670  This feature may not be available on all devices. Please refer to the
5671  specific device data sheet to determine availability or use
5672  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5673  whether this feature is available.
5674 */
5675 
5676 void
5678  USART_MODULE_ID index ) ;
5679 //******************************************************************************
5680 /* Function:
5681  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5682  Summary:
5683  Gets the transmit buffer full status.
5684  Description:
5685  This function gets the transmit status of the specified USART module.
5686  This operation is atomic.
5687  Precondition:
5688  None.
5689  Parameters:
5690  index - Identifier for the device instance to be configured
5691  Returns:
5692  - true - The transmit buffer is full
5693  - false - The transmit buffer is not full, at least one more
5694  character can be written
5695  Example:
5696  <code>
5697 #define MY_USART_INSTANCE USART_ID_1
5698  // Wait for the Transmit buffer to be empty.
5699  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5700  // Transmit the break character.
5701  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5702  </code>
5703  Remarks:
5704  This feature may not be available on all devices. Please refer to the
5705  specific device data sheet to determine availability or use
5706  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5707  whether this feature is available.
5708 */
5709 
5710 bool
5712  USART_MODULE_ID index ) ;
5713 //******************************************************************************
5714 /* Function:
5715  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5716  Summary:
5717  Gets the transmit shift register empty status.
5718  Description:
5719  This function gets the transmit shift register empty status.
5720  This operation is atomic.
5721  Precondition:
5722  None.
5723  Parameters:
5724  index - Identifier for the device instance to be configured
5725  Returns:
5726  - true - The transmit shift register is empty
5727  - false - The transmit shift register is not empty
5728  Example:
5729  <code>
5730 #define MY_USART_INSTANCE USART_ID_1
5731  // Wait for the Transmit buffer to be empty.
5732  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5733  // Transmit the break character.
5734  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5735  </code>
5736  Remarks:
5737  This feature may not be available on all devices. Please refer to the
5738  specific device data sheet to determine availability or use
5739  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5740  whether this feature is available.
5741 */
5742 
5743 bool
5745  USART_MODULE_ID index ) ;
5746 //******************************************************************************
5747 /* Function:
5748  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5749  Summary:
5750  Gets the framing error status.
5751  Description:
5752  This function gets the framing error status.
5753  This operation is atomic.
5754  Precondition:
5755  None.
5756  Parameters:
5757  index - Identifier for the device instance to be configured
5758  Returns:
5759  - true - The framing error was detected on the current character
5760  - false - The framing error was not detected on the current
5761  character
5762  Example:
5763  <code>
5764 #define MY_USART_INSTANCE USART_ID_1
5765  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5766  </code>
5767  Remarks:
5768  Reading the error clears the error.
5769  This feature may not be available on all devices. Please refer to the
5770  specific device data sheet to determine availability or use
5771  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5772  whether this feature is available.
5773 */
5774 
5775 bool
5777  USART_MODULE_ID index ) ;
5778 //******************************************************************************
5779 /* Function:
5780  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5781  Summary:
5782  Gets the parity error status.
5783  Description:
5784  This function gets the parity error status.
5785  This operation is atomic.
5786  Precondition:
5787  None.
5788  Parameters:
5789  index - Identifier for the device instance to be configured
5790  Returns:
5791  - true - The parity error was detected on the current character
5792  - false - The parity error was not detected on the current character
5793  Example:
5794  <code>
5795 #define MY_USART_INSTANCE USART_ID_1
5796  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5797  </code>
5798  Remarks:
5799  Reading the error clears the error.
5800  A Parity error is irrelevant in case of 9-bit mode.
5801  This feature may not be available on all devices. Please refer to the
5802  specific device data sheet to determine availability or use
5803  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5804  whether this feature is available.
5805 */
5806 
5807 bool
5809  USART_MODULE_ID index ) ;
5810 //******************************************************************************
5811 /* Function:
5812  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5813  Summary:
5814  Identifies if there was a receiver overrun error.
5815  Description:
5816  This function identifies if there was a receiver overrun error.
5817  This operation is atomic.
5818  Precondition:
5819  None.
5820  Parameters:
5821  index - Identifier for the device instance to be configured
5822  Returns:
5823  - true - The receive buffer has overflowed
5824  - false - The receive buffer has not overflowed
5825  Example:
5826  <code>
5827 #define MY_USART_INSTANCE USART_ID_1
5828  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5829  {
5830  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5831  }
5832  </code>
5833  Remarks:
5834  This feature may not be available on all devices. Please refer to the
5835  specific device data sheet to determine availability or use
5836  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5837  whether this feature is available.
5838 */
5839 
5840 bool
5842  USART_MODULE_ID index ) ;
5843 //******************************************************************************
5844 /* Function:
5845  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5846  Summary:
5847  Identifies if the receiver is idle.
5848  Description:
5849  This function identifies if the receiver is idle.
5850  This operation is atomic.
5851  Precondition:
5852  None.
5853  Parameters:
5854  index - Identifier for the device instance to be configured
5855  Returns:
5856  - true - The receive buffer is idle
5857  - false - The receive buffer is not idle
5858  Example:
5859  <code>
5860 #define MY_USART_INSTANCE USART_ID_1
5861  int8_t mydata;
5862  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5863  {
5864  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5865  }
5866  </code>
5867  Remarks:
5868  This feature may not be available on all devices. Please refer to the
5869  specific device data sheet to determine availability or use
5870  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5871  whether this feature is available.
5872 */
5873 
5874 bool
5876  USART_MODULE_ID index ) ;
5877 //******************************************************************************
5878 /* Function:
5879  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5880  Summary:
5881  Enables the USART receiver.
5882  Description:
5883  This function enables the USART receiver.
5884  This operation is atomic.
5885  Precondition:
5886  None.
5887  Parameters:
5888  index - Identifier for the device instance to be configured
5889  Returns:
5890  None.
5891  Example:
5892  <code>
5893 #define MY_USART_INSTANCE USART_ID_1
5894  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5895  </code>
5896  Remarks:
5897  This feature may not be available on all devices. Please refer to the
5898  specific device data sheet to determine availability or use
5899  PLIB_USART_ExistsReceiverEnable in your application to determine
5900  whether this feature is available.
5901 */
5902 
5903 void
5905  USART_MODULE_ID index ) ;
5906 //******************************************************************************
5907 /* Function:
5908  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5909  Summary:
5910  Disables the USART receiver.
5911  Description:
5912  This function disables the USART receiver.
5913  This operation is atomic.
5914  Precondition:
5915  None.
5916  Parameters:
5917  index - Identifier for the device instance to be configured
5918  Returns:
5919  None.
5920  Example:
5921  <code>
5922 #define MY_USART_INSTANCE USART_ID_1
5923  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
5924  </code>
5925  Remarks:
5926  This feature may not be available on all devices. Please refer to the
5927  specific device data sheet to determine availability or use
5928  PLIB_USART_ExistsReceiverEnable in your application to determine
5929  whether this feature is available.
5930 */
5931 
5932 void
5934  USART_MODULE_ID index ) ;
5935 //******************************************************************************
5936 /* Function:
5937  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
5938  Summary:
5939  Enables the Transmit Idle Low state.
5940  Description:
5941  This function enables the Transmit Idle Low state. In the USART Synchronous
5942  mode, this function configures that the TX polarity, the idle state is low.
5943  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
5944  state to a '1'.
5945  This operation is atomic.
5946  Precondition:
5947  None.
5948  Parameters:
5949  index - Identifier for the device instance to be configured
5950  Returns:
5951  None.
5952  Example:
5953  <code>
5954 #define MY_USART_INSTANCE USART_ID_1
5955  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
5956  </code>
5957  Remarks:
5958  This feature may not be available on all devices. Please refer to the
5959  specific device data sheet to determine availability or use
5960  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5961  whether this feature is available.
5962 */
5963 
5964 void
5966  USART_MODULE_ID index ) ;
5967 //******************************************************************************
5968 /* Function:
5969  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
5970  Summary:
5971  Disables the Transmit Idle Low state.
5972  Description:
5973  This function disables the Transmit Idle Low state. In USART Synchronous mode,
5974  this function configures that the TX polarity the idle state is high.
5975  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
5976  state to a '0'.
5977  This operation is atomic.
5978  Precondition:
5979  None.
5980  Parameters:
5981  index - Identifier for the device instance to be configured
5982  Returns:
5983  None.
5984  Example:
5985  <code>
5986 #define MY_USART_INSTANCE USART_ID_1
5987  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
5988  </code>
5989  Remarks:
5990  This feature may not be available on all devices. Please refer to the
5991  specific device data sheet to determine availability or use
5992  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5993  whether this feature is available.
5994 */
5995 
5996 void
5998  USART_MODULE_ID index ) ;
5999 //******************************************************************************
6000 /* Function:
6001  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6002  Summary:
6003  Enables receive polarity inversion.
6004  Description:
6005  This function enables receive polarity inversion. In the USART Synchronous mode,
6006  this function configures that the data is inverted.
6007  This operation is atomic.
6008  Precondition:
6009  None.
6010  Parameters:
6011  index - Identifier for the device instance to be configured
6012  Returns:
6013  None.
6014  Example:
6015  <code>
6016 #define MY_USART_INSTANCE USART_ID_1
6017  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6018  </code>
6019  Remarks:
6020  This feature may not be available on all devices. Please refer to the
6021  specific device data sheet to determine availability or use
6022  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6023  whether this feature is available.
6024 */
6025 
6026 void
6028  USART_MODULE_ID index ) ;
6029 //******************************************************************************
6030 /* Function:
6031  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6032  Summary:
6033  Disables receive polarity inversion.
6034  This operation is atomic.
6035  Description:
6036  This function disables receive polarity inversion. In the USART Synchronous
6037  mode, this function configures that the data is not inverted.
6038  Precondition:
6039  None.
6040  Parameters:
6041  index - Identifier for the device instance to be configured
6042  Returns:
6043  None.
6044  Example:
6045  <code>
6046 #define MY_USART_INSTANCE USART_ID_1
6047  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6048  </code>
6049  Remarks:
6050  This feature may not be available on all devices. Please refer to the
6051  specific device data sheet to determine availability or use
6052  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6053  whether this feature is available.
6054 */
6055 
6056 void
6058  USART_MODULE_ID index ) ;
6059 //******************************************************************************
6060 /* Function:
6061  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6062  Summary:
6063  Enables high baud rate selection.
6064  Description:
6065  This function enables high baud rate selection.
6066  This operation is atomic.
6067  Precondition:
6068  None.
6069  Parameters:
6070  index - Identifier for the device instance to be configured
6071  Returns:
6072  None.
6073  Example:
6074  <code>
6075 #define MY_USART_INSTANCE USART_ID_1
6076  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6077  </code>
6078  Remarks:
6079  This feature may not be available on all devices. Please refer to the
6080  specific device data sheet to determine availability or use
6081  PLIB_USART_ExistsBaudRateHigh in your application to determine
6082  whether this feature is available.
6083 */
6084 
6085 void
6087  USART_MODULE_ID index ) ;
6088 //******************************************************************************
6089 /* Function:
6090  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6091  Summary:
6092  Disables the high baud rate selection.
6093  Description:
6094  This function disables the high baud rate selection.
6095  This operation is atomic.
6096  Precondition:
6097  None.
6098  Parameters:
6099  index - Identifier for the device instance to be configured
6100  Returns:
6101  None.
6102  Example:
6103  <code>
6104 #define MY_USART_INSTANCE USART_ID_1
6105  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6106  </code>
6107  Remarks:
6108  This feature may not be available on all devices. Please refer to the
6109  specific device data sheet to determine availability or use
6110  PLIB_USART_ExistsBaudRateHigh in your application to determine
6111  whether this feature is available.
6112 */
6113 
6114 void
6116  USART_MODULE_ID index ) ;
6117 //******************************************************************************
6118 /* Function:
6119  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6120  USART_TRANSMIT_INTR_MODE interruptMode )
6121  Summary:
6122  Sets the USART transmitter interrupt mode.
6123  Description:
6124  This function sets the condition in which the USART module should generate
6125  an interrupt.
6126  This operation is atomic.
6127  Precondition:
6128  None.
6129  Parameters:
6130  index - Identifier for the device instance to be configured
6131  interruptMode - Interrupt mode; for possible configurations, refer to
6132  USART_TRANSMIT_INTR_MODE
6133  Returns:
6134  None.
6135  Example:
6136  <code>
6137 #define MY_USART_INSTANCE USART_ID_1
6138  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6139  USART_TRANSMIT_FIFO_EMPTY );
6140  </code>
6141  Remarks:
6142  This feature may not be available on all devices. Please refer to the
6143  specific device data sheet to determine availability or use
6144  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6145  whether this feature is available.
6146 */
6147 
6148 void
6150  USART_MODULE_ID index ,
6151  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6152 //******************************************************************************
6153 /* Function:
6154  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6155  USART_RECEIVE_INTR_MODE interruptMode )
6156  Summary:
6157  Sets the USART receiver FIFO level.
6158  Description:
6159  This function sets the USART receiver FIFO level.
6160  This operation is atomic.
6161  Precondition:
6162  None.
6163  Parameters:
6164  index - Identifier for the device instance to be configured
6165  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6166  Returns:
6167  None.
6168  Example:
6169  <code>
6170 #define MY_USART_INSTANCE USART_ID_1
6171  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6172  USART_RECEIVE_FIFO_ONE_CHAR );
6173  </code>
6174  Remarks:
6175  This feature may not be available on all devices. Please refer to the
6176  specific device data sheet to determine availability or use
6177  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6178  whether this feature is available.
6179 */
6180 
6181 void
6183  USART_MODULE_ID index ,
6184  USART_RECEIVE_INTR_MODE interruptMode ) ;
6185 //******************************************************************************
6186 /* Function:
6187  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6188  USART_LINECONTROL_MODE dataFlowConfig)
6189  Summary:
6190  Sets the data flow configuration.
6191  Description:
6192  This function sets the USART data flow configuration based on the mask
6193  provided and the specified baud rate.
6194  Precondition:
6195  None.
6196  Parameters:
6197  index - Identifier for the device instance to be configured
6198  mode - For possible data flow configurations, refer to
6199  USART_LINECONTROL_MODE
6200  Returns:
6201  None.
6202  Example:
6203  <code>
6204 #define MY_USART_INSTANCE USART_ID_1
6205  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6206  USART_8N1);
6207  </code>
6208  Remarks:
6209  This feature may not be available on all devices. Please refer to the
6210  specific device data sheet to determine availability or use
6211  PLIB_USART_ExistsLineControlMode in your application to determine
6212  whether this feature is available.
6213 */
6214 
6215 void
6217  USART_MODULE_ID index ,
6218  USART_LINECONTROL_MODE dataFlowConfig ) ;
6219 //******************************************************************************
6220 /* Function:
6221  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6222  USART_HANDSHAKE_MODE handshakeConfig)
6223  Summary:
6224  Sets the data flow configuration.
6225  Description:
6226  This function sets the USART data flow configuration based on the mask
6227  provided and the specified baud rate.
6228  Precondition:
6229  None.
6230  Parameters:
6231  index - Identifier for the device instance to be configured
6232  mode - For possible data flow configurations, refer to
6233  USART_HANDSHAKE_MODE
6234  Returns:
6235  None.
6236  Example:
6237  <code>
6238 #define MY_USART_INSTANCE USART_ID_1
6239  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6240  USART_HANDSHAKE_MODE_SIMPLEX);
6241  </code>
6242  Remarks:
6243  This feature may not be available on all devices. Please refer to the
6244  specific device data sheet to determine availability or use
6245  PLIB_USART_ExistsHandshakeMode in your application to determine
6246  whether this feature is available.
6247 */
6248 
6249 void
6251  USART_MODULE_ID index ,
6252  USART_HANDSHAKE_MODE handshakeConfig ) ;
6253 //******************************************************************************
6254 /* Function:
6255  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6256  int8_t Mask)
6257  Summary:
6258  Setup the automatic Address Detect mode.
6259  Description:
6260  This function configures the automatic Address Detect mode. Uses the mask as
6261  the address character for automatic address detection.
6262  This operation is atomic.
6263  Precondition:
6264  None.
6265  Parameters:
6266  index - Identifier for the device instance to be configured
6267  Mask - Address character to be used, when enabled
6268  Returns:
6269  None.
6270  Example:
6271  <code>
6272 #define MY_USART_INSTANCE USART_ID_1
6273  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6274  MY_DEVICE_ADDRESS);
6275  </code>
6276  Remarks:
6277  This feature may not be available on all devices. Please refer to the
6278  specific device data sheet to determine availability or use
6279  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6280  whether this feature is available.
6281 */
6282 
6283 void
6285  USART_MODULE_ID index ,
6286  int8_t Mask ) ;
6287 //******************************************************************************
6288 /* Function:
6289  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6290  USART_MODULE_ID index )
6291  Summary:
6292  Disables the automatic Address Detect mode.
6293  Description:
6294  This function disables the automatic Address Detect mode.
6295  This operation is atomic.
6296  Precondition:
6297  None.
6298  Parameters:
6299  index - Identifier for the device instance to be configured
6300  Returns:
6301  None.
6302  Example:
6303  <code>
6304 #define MY_USART_INSTANCE USART_ID_1
6305  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6306  </code>
6307  Remarks:
6308  This feature may not be available on all devices. Please refer to the
6309  specific device data sheet to determine availability or use
6310  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6311  whether this feature is available.
6312 */
6313 
6314 void
6316  USART_MODULE_ID index ) ;
6317 //******************************************************************************
6318 /* Function:
6319  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6320  Summary:
6321  Enables the IrDA encoder and decoder.
6322  Description:
6323  This function enables the IrDA encoder and decoder.
6324  This operation is atomic.
6325  Precondition:
6326  None.
6327  Parameters:
6328  index - Identifier for the device instance to be configured
6329  Returns:
6330  None.
6331  Example:
6332  <code>
6333 #define MY_USART_INSTANCE USART_ID_1
6334  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6335  </code>
6336  Remarks:
6337  This feature may not be available on all devices. Please refer to the
6338  specific device data sheet to determine availability or use
6339  PLIB_USART_ExistsIrDA in your application to determine
6340  whether this feature is available.
6341 */
6342 
6343 void
6345  USART_MODULE_ID index ) ;
6346 //******************************************************************************
6347 /* Function:
6348  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6349  Summary:
6350  Disables the IrDA encoder and decoder.
6351  Description:
6352  This function disables the IrDA encoder and decoder.
6353  This operation is atomic.
6354  Precondition:
6355  None.
6356  Parameters:
6357  index - Identifier for the device instance to be configured
6358  Returns:
6359  None.
6360  Example:
6361  <code>
6362 #define MY_USART_INSTANCE USART_ID_1
6363  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6364  </code>
6365  Remarks:
6366  By default, the IrDA Encoder and Decoder are disabled.
6367 
6368  This feature may not be available on all devices. Please refer to the
6369  specific device data sheet to determine availability or use
6370  PLIB_USART_ExistsIrDA in your application to determine
6371  whether this feature is available.
6372 */
6373 
6374 void
6376  USART_MODULE_ID index ) ;
6377 //******************************************************************************
6378 /* Function:
6379  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6380  Summary:
6381  Enables Loopback mode.
6382  Description:
6383  This function enables Loopback mode.
6384  This operation is atomic.
6385  Precondition:
6386  None.
6387  Parameters:
6388  index - Identifier for the device instance to be configured
6389  Returns:
6390  None.
6391  Example:
6392  <code>
6393 #define MY_USART_INSTANCE USART_ID_1
6394  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6395  </code>
6396  Remarks:
6397  By default, Loopback mode is disabled.
6398 
6399  This feature may not be available on all devices. Please refer to the
6400  specific device data sheet to determine availability or use
6401  PLIB_USART_ExistsLoopback in your application to determine
6402  whether this feature is available.
6403 */
6404 
6405 void
6407  USART_MODULE_ID index ) ;
6408 //******************************************************************************
6409 /* Function:
6410  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6411  Summary:
6412  Disables Loopback mode.
6413  Description:
6414  This function disables Loopback mode.
6415  This operation is atomic.
6416  Precondition:
6417  None.
6418  Parameters:
6419  index - Identifier for the device instance to be configured
6420  Returns:
6421  None.
6422  Example:
6423  <code>
6424 #define MY_USART_INSTANCE USART_ID_1
6425  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6426  </code>
6427  Remarks:
6428  By default, Loopback mode is disabled.
6429  This feature may not be available on all devices. Please refer to the
6430  specific device data sheet to determine availability or use
6431  PLIB_USART_ExistsLoopback in your application to determine
6432  whether this feature is available.
6433 */
6434 
6435 void
6437  USART_MODULE_ID index ) ;
6438 //******************************************************************************
6439 /* Function:
6440  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6441  USART_OPERATION_MODE operationmode)
6442  Summary:
6443  Configures the operation mode of the USART module.
6444  Description:
6445  This function configures the operation mode of the USART (i.e., controls the
6446  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6447  possible settings.
6448  Precondition:
6449  None.
6450  Parameters:
6451  index - Identifier for the device instance to be configured
6452  operationmode - One of the possible values from USART_OPERATION_MODE
6453  Returns:
6454  None.
6455  Example:
6456  <code>
6457 #define MY_USART_INSTANCE USART_ID_1
6458  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6459  </code>
6460  Remarks:
6461  This feature may not be available on all devices. Please refer to the
6462  specific device data sheet to determine availability or use
6463  PLIB_USART_ExistsOperationMode in your application to determine
6464  whether this feature is available.
6465 */
6466 
6467 void
6469  USART_MODULE_ID index ,
6470  USART_OPERATION_MODE operationmode ) ;
6471 //******************************************************************************
6472 /* Function:
6473  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6474  Summary:
6475  Discontinues operation when the device enters Idle mode.
6476  Description:
6477  This function enables the USART module to discontinue operation when the
6478  device enters Idle mode.
6479  This operation is atomic.
6480  Precondition:
6481  None.
6482  Parameters:
6483  index - Identifier for the device instance to be configured
6484  Returns:
6485  None.
6486  Example:
6487  <code>
6488 #define MY_USART_INSTANCE USART_ID_1
6489  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6490  </code>
6491  Remarks:
6492  This feature may not be available on all devices. Please refer to the
6493  specific device data sheet to determine availability or use
6494  PLIB_USART_ExistsStopInIdle in your application to determine
6495  whether this feature is available.
6496 */
6497 
6498 void
6500  USART_MODULE_ID index ) ;
6501 //******************************************************************************
6502 /* Function:
6503  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6504  Summary:
6505  Disables the Stop in Idle mode (the USART module continues operation when
6506  the device is in Idle mode).
6507  Description:
6508  This function disables the Stop in Idle mode. The USART module continues
6509  operation when the device is in Idle mode.
6510  This operation is atomic.
6511  Precondition:
6512  None.
6513  Parameters:
6514  index - Identifier for the device instance to be configured
6515  Returns:
6516  None.
6517  Example:
6518  <code>
6519 #define MY_USART_INSTANCE USART_ID_1
6520  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6521  </code>
6522  Remarks:
6523  By default, the USART module will continue operation in Idle mode.
6524 
6525  This feature may not be available on all devices. Please refer to the
6526  specific device data sheet to determine availability or use
6527  PLIB_USART_ExistsStopInIdle in your application to determine
6528  whether this feature is available.
6529 */
6530 
6531 void
6533  USART_MODULE_ID index ) ;
6534 //******************************************************************************
6535 /* Function:
6536  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6537  Summary:
6538  Enables the wake-up on start bit detection feature during Sleep mode.
6539  Description:
6540  This function enables the wake-up on start feature during Sleep mode.
6541  This operation is atomic.
6542  Precondition:
6543  None.
6544  Parameters:
6545  index - Identifier for the device instance to be configured
6546  Returns:
6547  None.
6548  Example:
6549  <code>
6550 #define MY_USART_INSTANCE USART_ID_1
6551  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6552  </code>
6553  Remarks:
6554  This feature may not be available on all devices. Please refer to the
6555  specific device data sheet to determine availability or use
6556  PLIB_USART_ExistsWakeOnStart in your application to determine
6557  whether this feature is available.
6558 */
6559 
6560 void
6562  USART_MODULE_ID index ) ;
6563 //******************************************************************************
6564 /* Function:
6565  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6566  Summary:
6567  Disables the wake-up on start bit detection feature during Sleep mode.
6568  Description:
6569  This function disables the wake-up on start bit detection feature during
6570  Sleep mode.
6571  This operation is atomic.
6572  Precondition:
6573  None.
6574  Parameters:
6575  index - Identifier for the device instance to be configured
6576  Returns:
6577  None.
6578  Example:
6579  <code>
6580 #define MY_USART_INSTANCE USART_ID_1
6581  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6582  </code>
6583  Remarks:
6584  This feature may not be available on all devices. Please refer to the
6585  specific device data sheet to determine availability or use
6586  PLIB_USART_ExistsWakeOnStart in your application to determine
6587  whether this feature is available.
6588 */
6589 
6590 void
6592  USART_MODULE_ID index ) ;
6593 //******************************************************************************
6594 /* Function:
6595  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6596  Summary:
6597  Gets the state of the sync break event completion.
6598  Description:
6599  This function returns the status of the sync break event, when called
6600  after enabling using PLIB_USART_WakeOnStartEnable.
6601  This operation is atomic.
6602  Precondition:
6603  None.
6604  Parameters:
6605  index - Identifier for the device instance to be configured
6606  Returns:
6607  None.
6608  Example:
6609  <code>
6610 #define MY_USART_INSTANCE USART_ID_1
6611  //Call the interface just prior to entering the sleep mode.
6612  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6613  // Check the status if the Sync break event is over.
6614  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6615  {
6616  // Do Something
6617  }
6618  </code>
6619  Remarks:
6620  This feature may not be available on all devices. Please refer to the
6621  specific device data sheet to determine availability or use
6622  PLIB_USART_ExistsWakeOnStart in your application to determine
6623  whether this feature is available.
6624 */
6625 
6626 bool
6628  USART_MODULE_ID index ) ;
6629 //******************************************************************************
6630 /* Function:
6631  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6632  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6633  Summary:
6634  Enables or disables general features of the USART module.
6635  Description:
6636  This function enables or disables general features of the USART module.
6637  Precondition:
6638  None.
6639  Parameters:
6640  index - Identifier for the device instance to be configured
6641  autobaud - If true, auto baud rate detection is enabled. If false
6642  the feature is disabled.
6643  loopBackMode - If true, loop back is enabled. If false the feature is
6644  disabled.
6645  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6646  mode on USART activity. If false the feature is disabled.
6647  irdaMode - If true, the IrDA mode is enabled. If false the feature
6648  is disabled.
6649  stopInIdle - If true, module will stop functioning when CPU enters Idle
6650  mode. If false, the feature is disabled.
6651  Returns:
6652  None.
6653  Example:
6654  <code>
6655 #define MY_USART_INSTANCE USART_ID_1
6656  // Enable loopback, disable IrDA, disable auto baud detection and disable
6657  // wake from sleep. Enable stop in idle
6658  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6659  false, false, true);
6660  </code>
6661  Remarks:
6662  Enabling the wake from sleep feature will cause the first character that is
6663  received by the USART module to be discarded. This feature should only be
6664  enabled if the CPU is to placed in power saving mode.
6665 
6666  This feature may not be available on all devices. Please refer to the
6667  specific device data sheet to determine availability. Availability of this
6668  function can also be determined if all of the following functions return
6669  true:
6670  - PLIB_USART_ExistsLoopback
6671  - PLIB_USART_ExistsBaudRateAutoDetect
6672  - PLIB_USART_ExistsWakeOnStart
6673  - PLIB_USART_ExistsIrDA
6674  - PLIB_USART_ExistsStopInIdle
6675 */
6676 
6677 void
6679  USART_MODULE_ID index ,
6680  bool autobaud ,
6681  bool loopBackMode ,
6682  bool wakeFromSleep ,
6683  bool irdaMode ,
6684  bool stopInIdle ) ;
6685 //******************************************************************************
6686 /* Function:
6687  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6688  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6689  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6690  USART_OPERATION_MODE operationMode);
6691  Summary:
6692  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6693  lines to be used by the module.
6694  Description:
6695  This function configures the Receive and Transmit FIFO interrupt levels and
6696  the hardware lines to be used by the module.
6697  Precondition:
6698  None.
6699  Parameters:
6700  index - Identifier for the device instance to be configured
6701  receiveInterruptMode - Receiver FIFO interrupt level
6702  transmitInterruptMode - Transmit FIFO interrupt level
6703  operationMode - Hardware lines to be used by the USART.
6704  Returns:
6705  None.
6706  Example:
6707  <code>
6708 #define MY_USART_INSTANCE USART_ID_1
6709  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6710  // Set Transmit FIFO to interrupt when FIFO is empty
6711  // USART module will only use RX and TX hardware lines
6712  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6713  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6714  </code>
6715  Remarks:
6716  This feature may not be available on all devices. Please refer to the
6717  specific device data sheet to determine availability. Availability of this
6718  function can also be determined if all of the following functions return
6719  true:
6720  - PLIB_USART_ExistsReceiverInterruptMode
6721  - PLIB_USART_ExistsTransmitterInterruptMode
6722  - PLIB_USART_ExistsOperationMode
6723 */
6724 
6725 void
6727  USART_MODULE_ID index ,
6728  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6729  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6730  USART_OPERATION_MODE operationMode ) ;
6731 //******************************************************************************
6732 /* Function:
6733  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6734  clockFrequency, uint32_t baudRate );
6735  Summary:
6736  Sets the baud rate to the desired value and enables the USART receiver,
6737  transmitter and the USART module.
6738  Description:
6739  This function sets the baud rate to the desired value and enables the USART
6740  receiver, USART transmitter and USART module.
6741  Precondition:
6742  None.
6743  Parameters:
6744  index - Identifier for the device instance to be configured
6745  baudRate - Baud Rate Value
6746  clockFrequency - Clock Frequency
6747  Returns:
6748  None.
6749  Example:
6750  <code>
6751 #define MY_USART_INSTANCE USART_ID_1
6752  uint32_t baudRateValue ;
6753  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6754  </code>
6755  Remarks:
6756  Setting a new baud rate value causes the baud rate timer to reset.
6757  This ensures that the baud rate timer does not have to overflow before
6758  outputting the new baud rate.
6759 
6760  If the system clock is changed during an active receive operation, a
6761  receiver error or data loss may result. To avoid this issue verify that
6762  no receptions are in progress before changing the system clock.
6763 
6764  This feature may not be available on all devices. Please refer to the
6765  specific device data sheet to determine availability. Availability of this
6766  function can also be determined if all of the following functions return
6767  true:
6768  - PLIB_USART_ExistsBaudRate
6769  - PLIB_USART_ExistsTransmitterEnable
6770  - PLIB_USART_ExistsReceiverEnable
6771  - PLIB_USART_ExistsEnable
6772 */
6773 
6774 void
6776  USART_MODULE_ID index ,
6777  uint32_t systemClock ,
6778  uint32_t baud ) ;
6779 //******************************************************************************
6780 /* Function:
6781  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6782  Summary:
6783  Return the status of all errors in the specified USART module.
6784  Description:
6785  This function returns status of all errors in the specified USART module.
6786  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6787  status of a specific error.
6788  This operation is atomic.
6789  Precondition:
6790  None.
6791  Parameters:
6792  index - Identifier for the device instance to be configured
6793  Returns:
6794  Returns a bitmap of USART error status.
6795  Example:
6796  <code>
6797 #define MY_USART_INSTANCE USART_ID_1
6798  USART_ERROR error;
6799  // Get the status of all errors.
6800  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6801  // Check if parity error is active
6802  if(error & USART_ERROR_PARITY)
6803  {
6804  // Parity error is active.
6805  }
6806  else if(error & USART_ERROR_FRAMING)
6807  {
6808  // Framing error is active.
6809  }
6810  </code>
6811  Remarks:
6812  This feature may not be available on all devices. Please refer to the
6813  specific device data sheet to determine availability. Availability of this
6814  function can also be determined if all of the followings functions return
6815  true:
6816  - PLIB_USART_ExistsReceiverFramingErrorStatus
6817  - PLIB_USART_ExistsReceiverParityErrorStatus
6818  - PLIB_USART_ExistsReceiverOverrunStatus
6819 */
6820 
6821 USART_ERROR
6823  USART_MODULE_ID index ) ;
6824 //******************************************************************************
6825 /* Function:
6826  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6827  Summary:
6828  Returns the address of the USART TX register
6829  Description:
6830  This function returns the address of the USART TX register.
6831  This operation is atomic.
6832  Preconditions:
6833  None.
6834  Parameters:
6835  index - Identifier for the device instance
6836  Returns:
6837  Address of the USART TX register
6838  Remarks:
6839  None.
6840 */
6841 
6842 void *
6844  USART_MODULE_ID index ) ;
6845 //******************************************************************************
6846 /* Function:
6847  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6848  Summary:
6849  Returns the address of the USART RX register
6850  Description:
6851  This function returns the address of the USART RX register.
6852  This operation is atomic.
6853  Preconditions:
6854  None.
6855  Parameters:
6856  index - Identifier for the device instance
6857  Returns:
6858  Address of the USART RX register
6859  Remarks:
6860  None.
6861 */
6862 
6863 void *
6865  USART_MODULE_ID index ) ;
6866 // *****************************************************************************
6867 // *****************************************************************************
6868 // Section: USART Peripheral Library Exists Functions
6869 // *****************************************************************************
6870 // *****************************************************************************
6871 /* The following functions indicate the existence of the features on the device.
6872 */
6873 //******************************************************************************
6874 /* Function:
6875  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6876  Summary:
6877  Identifies whether the Run in overflow condition feature exists on the USART module.
6878  Description:
6879  This function identifies whether the Run in Overflow condition feature is
6880  available on the USART module. When this function returns true, these
6881  functions are supported on the device:
6882  - PLIB_USART_RunInOverflowEnable
6883  - PLIB_USART_RunInOverflowDisable
6884  - PLIB_USART_RunInOverflowIsEnabled
6885  This operation is atomic.
6886  Preconditions:
6887  None.
6888  Parameters:
6889  index - Identifier for the device instance
6890  Returns:
6891  - true - The Run in Overflow condition feature is supported on the device
6892  - false - The Run in Overflow condition feature is not supported on the device
6893  Remarks:
6894  None.
6895 */
6896 
6897 bool
6899  USART_MODULE_ID index ) ;
6900 //******************************************************************************
6901 /* Function:
6902  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6903  Summary:
6904  Identifies whether the BRG Clock source select feature exists on the
6905  USART module.
6906  Description:
6907  This function identifies whether the BRG Clock source select feature is
6908  available on the USART module. When this function returns true, these
6909  functions are supported on the device:
6910  - PLIB_USART_BRGClockSourceSelect
6911  - PLIB_USART_BRGClockSourceGet
6912  This operation is atomic.
6913  Preconditions:
6914  None.
6915  Parameters:
6916  index - Identifier for the device instance
6917  Returns:
6918  - true - The BRG clock source select feature is supported on the device
6919  - false - The BRG clock source select feature is not supported on the device
6920  Remarks:
6921  None.
6922 */
6923 
6924 bool
6926  USART_MODULE_ID index ) ;
6927 //******************************************************************************
6928 /* Function:
6929  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
6930  Summary:
6931  Identifies whether the module running status feature exists on the
6932  USART module.
6933  Description:
6934  This function identifies whether the module running status feature is
6935  available on the USART module. When this function returns true, this
6936  function is supported on the device:
6937  - PLIB_USART_ModuleIsBusy
6938  This operation is atomic.
6939  Preconditions:
6940  None.
6941  Parameters:
6942  index - Identifier for the device instance
6943  Returns:
6944  - true - The Module running status feature is supported on the device
6945  - false - The Module running status feature is not supported on the device
6946  Remarks:
6947  None.
6948 */
6949 
6950 bool
6952  USART_MODULE_ID index ) ;
6953 //******************************************************************************
6954 /* Function:
6955  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
6956  Summary:
6957  Identifies whether the Run in Sleep mode feature exists on the USART module.
6958  Description:
6959  This function identifies whether the Run in Sleep mode feature is
6960  available on the USART module. When this function returns true, these
6961  functions are supported on the device:
6962  - PLIB_USART_RunInSleepModeEnable
6963  - PLIB_USART_RunInSleepModeDisable
6964  - PLIB_USART_RunInSleepModeIsEnabled
6965  This operation is atomic.
6966  Preconditions:
6967  None.
6968  Parameters:
6969  index - Identifier for the device instance
6970  Returns:
6971  - true - The Run in Sleep mode feature is supported on the device
6972  - false - The Run in Sleep mode feature is not supported on the device
6973  Remarks:
6974  None.
6975 */
6976 
6977 bool
6979  USART_MODULE_ID index ) ;
6980 //******************************************************************************
6981 /* Function:
6982  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
6983  Summary:
6984  Identifies whether the EnableControl feature exists on the USART module.
6985  Description:
6986  This function identifies whether the EnableControl feature is
6987  available on the USART module. When this function returns true, these
6988  functions are supported on the device:
6989  - PLIB_USART_Disable
6990  - PLIB_USART_Enable
6991  This operation is atomic.
6992  Preconditions:
6993  None.
6994  Parameters:
6995  index - Identifier for the device instance
6996  Returns:
6997  - true - The EnableControl feature is supported on the device
6998  - false - The EnableControl feature is not supported on the device
6999  Remarks:
7000  None.
7001 */
7002 
7003 bool
7005  USART_MODULE_ID index ) ;
7006 //******************************************************************************
7007 /* Function:
7008  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7009  Summary:
7010  Identifies whether the HandShakeMode feature exists on the USART module.
7011  Description:
7012  This function identifies whether the HandShakeMode feature is
7013  available on the USART module. When this function returns true, this
7014  function is supported on the device:
7015  - PLIB_USART_HandshakeModeSelect
7016  This operation is atomic.
7017  Preconditions:
7018  None.
7019  Parameters:
7020  index - Identifier for the device instance
7021  Returns:
7022  - true - The HandShakeMode feature is supported on the device
7023  - false - The HandShakeMode feature is not supported on the device
7024  Remarks:
7025  None.
7026 */
7027 
7028 bool
7030  USART_MODULE_ID index ) ;
7031 //******************************************************************************
7032 /* Function:
7033  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7034  Summary:
7035  Identifies whether the IrDAControl feature exists on the USART module.
7036  Description:
7037  This function identifies whether the IrDAControl feature is
7038  available on the USART module. When this function returns true, these
7039  functions are supported on the device:
7040  - PLIB_USART_IrDADisable
7041  - PLIB_USART_IrDAEnable
7042  This operation is atomic.
7043  Preconditions:
7044  None.
7045  Parameters:
7046  index - Identifier for the device instance
7047  Returns:
7048  - true - The IrDAControl feature is supported on the device
7049  - false - The IrDAControl feature is not supported on the device
7050  Remarks:
7051  None.
7052 */
7053 
7054 bool
7056  USART_MODULE_ID index ) ;
7057 //******************************************************************************
7058 /* Function:
7059  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7060  Summary:
7061  Identifies whether the LineControlMode feature exists on the USART module.
7062  Description:
7063  This function identifies whether the LineControlMode feature is
7064  available on the USART module. When this function returns true, this
7065  function is supported on the device:
7066  - PLIB_USART_LineControlModeSelect
7067  This operation is atomic.
7068  Preconditions:
7069  None.
7070  Parameters:
7071  index - Identifier for the device instance
7072  Returns:
7073  - true - The LineControlMode feature is supported on the device
7074  - false - The LineControlMode feature is not supported on the device
7075  Remarks:
7076  None.
7077 */
7078 
7079 bool
7081  USART_MODULE_ID index ) ;
7082 //******************************************************************************
7083 /* Function:
7084  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7085  Summary:
7086  Identifies whether the Loopback feature exists on the USART module.
7087  Description:
7088  This function identifies whether the Loopback feature is
7089  available on the USART module. When this function returns true, these
7090  functions are supported on the device:
7091  - PLIB_USART_LoopbackEnable
7092  - PLIB_USART_LoopbackDisable
7093  This operation is atomic.
7094  Preconditions:
7095  None.
7096  Parameters:
7097  index - Identifier for the device instance
7098  Returns:
7099  - true - The Loopback feature is supported on the device
7100  - false - The Loopback feature is not supported on the device
7101  Remarks:
7102  None.
7103 */
7104 
7105 bool
7107  USART_MODULE_ID index ) ;
7108 //******************************************************************************
7109 /* Function:
7110  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7111  Summary:
7112  Identifies whether the OperationMode feature exists on the USART module.
7113  Description:
7114  This function identifies whether the OperationMode feature is
7115  available on the USART module. When this function returns true, this
7116  function is supported on the device:
7117  - PLIB_USART_OperationModeSelect
7118  This operation is atomic.
7119  Preconditions:
7120  None.
7121  Parameters:
7122  index - Identifier for the device instance
7123  Returns:
7124  - true - The OperationMode feature is supported on the device
7125  - false - The OperationMode feature is not supported on the device
7126  Remarks:
7127  None.
7128 */
7129 
7130 bool
7132  USART_MODULE_ID index ) ;
7133 //******************************************************************************
7134 /* Function:
7135  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7136  Summary:
7137  Identifies whether the StopInIdle feature exists on the USART module.
7138  Description:
7139  This function identifies whether the StopInIdle feature is
7140  available on the USART module. When this function returns true, these
7141  functions are supported on the device:
7142  - PLIB_USART_StopInIdleEnable
7143  - PLIB_USART_StopInIdleDisable
7144  This operation is atomic.
7145  Preconditions:
7146  None.
7147  Parameters:
7148  index - Identifier for the device instance
7149  Returns:
7150  - true - The StopInIdle feature is supported on the device
7151  - false - The StopInIdle feature is not supported on the device
7152  Remarks:
7153  None.
7154 */
7155 
7156 bool
7158  USART_MODULE_ID index ) ;
7159 //******************************************************************************
7160 /* Function:
7161  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7162  Summary:
7163  Identifies whether the WakeOnStart feature exists on the USART module.
7164  Description:
7165  This function identifies whether the WakeOnStart feature is
7166  available on the USART module. When this function returns true, these
7167  functions are supported on the device:
7168  - PLIB_USART_WakeOnStartEnable
7169  - PLIB_USART_WakeOnStartDisable
7170  - PLIB_USART_WakeOnStartIsEnabled
7171  This operation is atomic.
7172  Preconditions:
7173  None.
7174  Parameters:
7175  index - Identifier for the device instance
7176  Returns:
7177  - true - The WakeOnStart feature is supported on the device
7178  - false - The WakeOnStart feature is not supported on the device
7179  Remarks:
7180  None.
7181 */
7182 
7183 bool
7185  USART_MODULE_ID index ) ;
7186 //******************************************************************************
7187 /* Function:
7188  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7189  Summary:
7190  Identifies whether the BaudRate feature exists on the USART module.
7191  Description:
7192  This function identifies whether the BaudRate feature is
7193  available on the USART module. When this function returns true, these
7194  functions are supported on the device:
7195  - PLIB_USART_BaudRateSet
7196  - PLIB_USART_BaudRateGet
7197  This operation is atomic.
7198  Preconditions:
7199  None.
7200  Parameters:
7201  index - Identifier for the device instance
7202  Returns:
7203  - true - The BaudRate feature is supported on the device
7204  - false - The BaudRate feature is not supported on the device
7205  Remarks:
7206  None.
7207 */
7208 
7209 bool
7211  USART_MODULE_ID index ) ;
7212 //******************************************************************************
7213 /* Function:
7214  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7215  Summary:
7216  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7217  Description:
7218  This function identifies whether the BaudRateAutoDetect feature is
7219  available on the USART module. When this function returns true, these
7220  functions are supported on the device:
7221  - PLIB_USART_BaudRateAutoDetectEnable
7222  - PLIB_USART_BaudRateAutoDetectIsComplete
7223  This operation is atomic.
7224  Preconditions:
7225  None.
7226  Parameters:
7227  index - Identifier for the device instance
7228  Returns:
7229  - true - The BaudRateAutoDetect feature is supported on the device
7230  - false - The BaudRateAutoDetect feature is not supported on the device
7231  Remarks:
7232  None.
7233 */
7234 
7235 bool
7237  USART_MODULE_ID index ) ;
7238 //******************************************************************************
7239 /* Function:
7240  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7241  Summary:
7242  Identifies whether the BaudRateHigh feature exists on the USART module.
7243  Description:
7244  This function identifies whether the BaudRateHigh feature is
7245  available on the USART module. When this function returns true, these
7246  functions are supported on the device:
7247  - PLIB_USART_BaudRateHighSet
7248  - PLIB_USART_BaudRateHighDisable
7249  - PLIB_USART_BaudRateHighEnable
7250  This operation is atomic.
7251  Preconditions:
7252  None.
7253  Parameters:
7254  index - Identifier for the device instance
7255  Returns:
7256  - true - The BaudRateHigh feature is supported on the device
7257  - false - The BaudRateHigh feature is not supported on the device
7258  Remarks:
7259  None.
7260 */
7261 
7262 bool
7264  USART_MODULE_ID index ) ;
7265 //******************************************************************************
7266 /* Function:
7267  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7268  Summary:
7269  Identifies whether the Receiver Address feature exists on the USART
7270  module.
7271  Description:
7272  This function identifies whether the Receiver Address feature is
7273  available on the USART module. When this function returns true, these
7274  functions are supported on the device:
7275  - PLIB_USART_AddressSet
7276  - PLIB_USART_AddressGet
7277  This operation is atomic.
7278  Preconditions:
7279  None.
7280  Parameters:
7281  index - Identifier for the device instance
7282  Returns:
7283  - true - The Receiver address feature is supported on the device
7284  - false - The Receiver address feature is not supported on the device
7285  Remarks:
7286  None.
7287 */
7288 
7289 bool
7291  USART_MODULE_ID index ) ;
7292 //******************************************************************************
7293 /* Function:
7294  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7295  Summary:
7296  Identifies whether the Receiver Address Mask feature exists on the USART
7297  module.
7298  Description:
7299  This function identifies whether the Receiver Address Mask feature is
7300  available on the USART module. When this function returns true, these
7301  functions are supported on the device:
7302  - PLIB_USART_AddressMaskSet
7303  - PLIB_USART_AddressMaskGet
7304  This operation is atomic.
7305  Preconditions:
7306  None.
7307  Parameters:
7308  index - Identifier for the device instance
7309  Returns:
7310  - true - The Receiver address mask feature is supported on the device
7311  - false - The Receiver address mask feature is not supported on the device
7312  Remarks:
7313  None.
7314 */
7315 
7316 bool
7318  USART_MODULE_ID index ) ;
7319 //******************************************************************************
7320 /* Function:
7321  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7322  Summary:
7323  Identifies whether the Receiver feature exists on the USART module.
7324  Description:
7325  This function identifies whether the Receiver feature is available on the
7326  USART module. When this function returns true, these functions are supported
7327  on the device:
7328  - PLIB_USART_ReceiverByteReceive
7329  - PLIB_USART_ReceiverAddressGet
7330  This operation is atomic.
7331  Preconditions:
7332  None.
7333  Parameters:
7334  index - Identifier for the device instance
7335  Returns:
7336  - true - The Receiver feature is supported on the device
7337  - false - The Receiver feature is not supported on the device
7338  Remarks:
7339  None.
7340 */
7341 
7342 bool
7344  USART_MODULE_ID index ) ;
7345 //******************************************************************************
7346 /* Function:
7347  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7348  Summary:
7349  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7350  Description:
7351  This function identifies whether the 9 Bits Receiver feature is available on the
7352  USART module. When this function returns true, this function is supported
7353  on the device:
7354  - PLIB_USART_Receiver9BitsReceive
7355  This operation is atomic.
7356  Preconditions:
7357  None.
7358  Parameters:
7359  index - Identifier for the device instance
7360  Returns:
7361  - true - The feature is supported on the device
7362  - false - The feature is not supported on the device
7363  Remarks:
7364  None.
7365 */
7366 
7367 bool
7369  USART_MODULE_ID index ) ;
7370 //******************************************************************************
7371 /* Function:
7372  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7373  Summary:
7374  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7375  Description:
7376  This function identifies whether the ReceiverAddressAutoDetect feature is
7377  available on the USART module. When this function returns true, these
7378  functions are supported on the device:
7379  - PLIB_USART_ReceiverAddressAutoDetectEnable
7380  - PLIB_USART_ReceiverAddressAutoDetectDisable
7381  This operation is atomic.
7382  Preconditions:
7383  None.
7384  Parameters:
7385  index - Identifier for the device instance
7386  Returns:
7387  - true - The ReceiverAddressAutoDetect feature is supported on the device
7388  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7389  Remarks:
7390  None.
7391 */
7392 
7393 bool
7395  USART_MODULE_ID index ) ;
7396 //******************************************************************************
7397 /* Function:
7398  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7399  Summary:
7400  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7401  Description:
7402  This function identifies whether the ReceiverAddressDetect feature is
7403  available on the USART module. When this function returns true, these
7404  functions are supported on the device:
7405  - PLIB_USART_ReceiverAddressDetectEnable
7406  - PLIB_USART_ReceiverAddressDetectDisable
7407  - PLIB_USART_ReceiverAddressIsReceived
7408  This operation is atomic.
7409  Preconditions:
7410  None.
7411  Parameters:
7412  index - Identifier for the device instance
7413  Returns:
7414  - true - The ReceiverAddressDetect feature is supported on the device
7415  - false - The ReceiverAddressDetect feature is not supported on the device
7416  Remarks:
7417  None.
7418 */
7419 
7420 bool
7422  USART_MODULE_ID index ) ;
7423 //******************************************************************************
7424 /* Function:
7425  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7426  Summary:
7427  Identifies whether the ReceiverDataAvailable feature exists on the USART
7428  module
7429  Description:
7430  This function identifies whether the ReceiverDataAvailable feature is
7431  available on the USART module. When this function returns true, this
7432  function is supported on the device:
7433  - PLIB_USART_ReceiverDataIsAvailable
7434  This operation is atomic.
7435  Preconditions:
7436  None.
7437  Parameters:
7438  index - Identifier for the device instance
7439  Returns:
7440  - true - The ReceiverDataAvailable feature is supported on the device
7441  - false - The ReceiverDataAvailable feature is not supported on the device
7442  Remarks:
7443  None.
7444 */
7445 
7446 bool
7448  USART_MODULE_ID index ) ;
7449 //******************************************************************************
7450 /* Function:
7451  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7452  Summary:
7453  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7454  Description:
7455  This function identifies whether the ReceiverEnableControl feature is
7456  available on the USART module. When this function returns true, these
7457  functions are supported on the device:
7458  - PLIB_USART_ReceiverEnable
7459  - PLIB_USART_ReceiverDisable
7460  This operation is atomic.
7461  Preconditions:
7462  None.
7463  Parameters:
7464  index - Identifier for the device instance
7465  Returns:
7466  - true - The ReceiverEnableControl feature is supported on the device
7467  - false - The ReceiverEnableControl feature is not supported on the device
7468  Remarks:
7469  None.
7470 */
7471 
7472 bool
7474  USART_MODULE_ID index ) ;
7475 //******************************************************************************
7476 /* Function:
7477  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7478  Summary:
7479  Identifies whether the ReceiverIdle feature exists on the USART module.
7480  Description:
7481  This function identifies whether the ReceiverIdle feature is
7482  available on the USART module. When this function returns true, this
7483  function is supported on the device:
7484  - PLIB_USART_ReceiverIsIdle
7485  This operation is atomic.
7486  Preconditions:
7487  None.
7488  Parameters:
7489  index - Identifier for the device instance
7490  Returns:
7491  - true - The ReceiverIdle feature is supported on the device
7492  - false - The ReceiverIdle feature is not supported on the device
7493  Remarks:
7494  None.
7495 */
7496 
7497 bool
7499  USART_MODULE_ID index ) ;
7500 //******************************************************************************
7501 /* Function:
7502  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7503  Summary:
7504  Identifies whether the ReceiverFramingError feature exists on the USART module.
7505  Description:
7506  This function identifies whether the ReceiverFramingError feature is
7507  available on the USART module. When this function returns true, this
7508  function is supported on the device:
7509  - PLIB_USART_ReceiverFramingErrorHasOccurred
7510  This operation is atomic.
7511  Preconditions:
7512  None.
7513  Parameters:
7514  index - Identifier for the device instance
7515  Returns:
7516  - true - The ReceiverFramingError feature is supported on the device
7517  - false - The ReceiverFramingError feature is not supported on the device
7518  Remarks:
7519  None.
7520 */
7521 
7522 bool
7524  USART_MODULE_ID index ) ;
7525 //******************************************************************************
7526 /* Function:
7527  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7528  Summary:
7529  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7530  Description:
7531  This function identifies whether the ReceiverInterruptMode feature is
7532  available on the USART module. When this function returns true, this
7533  function is supported on the device:
7534  - PLIB_USART_ReceiverInterruptModeSelect
7535  This operation is atomic.
7536  Preconditions:
7537  None.
7538  Parameters:
7539  index - Identifier for the device instance
7540  Returns:
7541  - true - The ReceiverInterruptMode feature is supported on the device
7542  - false - The ReceiverInterruptMode feature is not supported on the device
7543  Remarks:
7544  None.
7545 */
7546 
7547 bool
7549  USART_MODULE_ID index ) ;
7550 //******************************************************************************
7551 /* Function:
7552  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7553  Summary:
7554  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7555  Description:
7556  This function identifies whether the ReceiverPolarityInvert feature is
7557  available on the USART module. When this function returns true, these
7558  functions are supported on the device:
7559  - PLIB_USART_ReceiverIdleStateLowEnable
7560  - PLIB_USART_ReceiverIdleStateLowDisable
7561  This operation is atomic.
7562  Preconditions:
7563  None.
7564  Parameters:
7565  index - Identifier for the device instance
7566  Returns:
7567  - true - The ReceiverPolarityInvert feature is supported on the device
7568  - false - The ReceiverPolarityInvert feature is not supported on the device
7569  Remarks:
7570  None.
7571 */
7572 
7573 bool
7575  USART_MODULE_ID index ) ;
7576 //******************************************************************************
7577 /* Function:
7578  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7579  Summary:
7580  Identifies whether the ReceiverParityError feature exists on the USART module.
7581  Description:
7582  This function identifies whether the ReceiverParityError feature is
7583  available on the USART module. When this function returns true, this
7584  function is supported on the device:
7585  - PLIB_USART_ReceiverParityErrorHasOccurred
7586  This operation is atomic.
7587  Preconditions:
7588  None.
7589  Parameters:
7590  index - Identifier for the device instance
7591  Returns:
7592  - true - The ReceiverParityError feature is supported on the device
7593  - false - The ReceiverParityError feature is not supported on the device
7594  Remarks:
7595  None.
7596 */
7597 
7598 bool
7600  USART_MODULE_ID index ) ;
7601 //******************************************************************************
7602 /* Function:
7603  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7604  Summary:
7605  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7606  Description:
7607  This function identifies whether the ReceiverOverrunError feature is
7608  available on the USART module. When this function returns true, these
7609  functions are supported on the device:
7610  - PLIB_USART_ReceiverOverrunErrorClear
7611  - PLIB_USART_ReceiverOverrunHasOccurred
7612  This operation is atomic.
7613  Preconditions:
7614  None.
7615  Parameters:
7616  index - Identifier for the device instance
7617  Returns:
7618  - true - The ReceiverOverrunError feature is supported on the device
7619  - false - The ReceiverOverrunError feature is not supported on the device
7620  Remarks:
7621  None.
7622 */
7623 
7624 bool
7626  USART_MODULE_ID index ) ;
7627 //******************************************************************************
7628 /* Function:
7629  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7630  Summary:
7631  Identifies whether the Transmitter feature exists on the USART module.
7632  Description:
7633  This function identifies whether the Transmitter feature is
7634  available on the USART module. When this function returns true, these
7635  functions are supported on the device:
7636  - PLIB_USART_TransmitterByteSend
7637  - PLIB_USART_TransmitterAddressGet
7638  This operation is atomic.
7639  Preconditions:
7640  None.
7641  Parameters:
7642  index - Identifier for the device instance
7643  Returns:
7644  - true - The Transmitter feature is supported on the device
7645  - false - The Transmitter feature is not supported on the device
7646  Remarks:
7647  None.
7648 */
7649 
7650 bool
7652  USART_MODULE_ID index ) ;
7653 //******************************************************************************
7654 /* Function:
7655  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7656  Summary:
7657  Identifies whether the Transmitter9Bits feature exists on the USART module.
7658  Description:
7659  This function identifies whether the Transmitter9Bits feature is
7660  available on the USART module. When this function returns true, this
7661  function is supported on the device:
7662  - PLIB_USART_Transmitter9BitsSend
7663  This operation is atomic.
7664  Preconditions:
7665  None.
7666  Parameters:
7667  index - Identifier for the device instance
7668  Returns:
7669  - true - The Transmitter9Bits feature is supported on the device
7670  - false - The Transmitter9Bits feature is not supported on the device
7671  Remarks:
7672  None.
7673 */
7674 
7675 bool
7677  USART_MODULE_ID index ) ;
7678 //******************************************************************************
7679 /* Function:
7680  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7681  Summary:
7682  Identifies whether the TransmitterBreak feature exists on the USART module.
7683  Description:
7684  This function identifies whether the TransmitterBreak feature is
7685  available on the USART module. When this function returns true, these
7686  functions are supported on the device:
7687  - PLIB_USART_TransmitterBreakSend
7688  - PLIB_USART_TransmitterBreakSendIsComplete
7689  This operation is atomic.
7690  Preconditions:
7691  None.
7692  Parameters:
7693  index - Identifier for the device instance
7694  Returns:
7695  - true - The TransmitterBreak feature is supported on the device
7696  - false - The TransmitterBreak feature is not supported on the device
7697  Remarks:
7698  None.
7699 */
7700 
7701 bool
7703  USART_MODULE_ID index ) ;
7704 //******************************************************************************
7705 /* Function:
7706  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7707  Summary:
7708  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7709  Description:
7710  This function identifies whether the TransmitterBufferFull feature is
7711  available on the USART module. When this function returns true, this
7712  function is supported on the device:
7713  - PLIB_USART_TransmitterBufferIsFull
7714  This operation is atomic.
7715  Preconditions:
7716  None.
7717  Parameters:
7718  index - Identifier for the device instance
7719  Returns:
7720  - true - The TransmitterBufferFull feature is supported on the device
7721  - false - The TransmitterBufferFull feature is not supported on the device
7722  Remarks:
7723  None.
7724 */
7725 
7726 bool
7728  USART_MODULE_ID index ) ;
7729 //******************************************************************************
7730 /* Function:
7731  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7732  Summary:
7733  Identifies whether the TransmitterEmpty feature exists on the USART module.
7734  Description:
7735  This function identifies whether the TransmitterEmpty feature is
7736  available on the USART module. When this function returns true, this
7737  function is supported on the device:
7738  - PLIB_USART_TransmitterIsEmpty
7739  This operation is atomic.
7740  Preconditions:
7741  None.
7742  Parameters:
7743  index - Identifier for the device instance
7744  Returns:
7745  - true - The TransmitterEmpty feature is supported on the device
7746  - false - The TransmitterEmpty feature is not supported on the device
7747  Remarks:
7748  None.
7749 */
7750 
7751 bool
7753  USART_MODULE_ID index ) ;
7754 //******************************************************************************
7755 /* Function:
7756  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7757  Summary:
7758  Identifies whether the TransmitterEnableControl feature exists on the USART
7759  module
7760  Description:
7761  This function identifies whether the TransmitterEnableControl feature is
7762  available on the USART module. When this function returns true, these
7763  functions are supported on the device:
7764  - PLIB_USART_TransmitterEnable
7765  - PLIB_USART_TransmitterDisable
7766  This operation is atomic.
7767  Preconditions:
7768  None.
7769  Parameters:
7770  index - Identifier for the device instance
7771  Returns:
7772  - true - The TransmitterEnableControl feature is supported on the device
7773  - false - The TransmitterEnableControl feature is not supported on the device
7774  Remarks:
7775  None.
7776 */
7777 
7778 bool
7780  USART_MODULE_ID index ) ;
7781 //******************************************************************************
7782 /* Function:
7783  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7784  Summary:
7785  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7786  Description:
7787  This function identifies whether the TransmitterInterruptMode feature is
7788  available on the USART module. When this function returns true, this function
7789  is supported on the device:
7790  - PLIB_USART_TransmitterInterruptModeSelect
7791  This operation is atomic.
7792  Preconditions:
7793  None.
7794  Parameters:
7795  index - Identifier for the device instance
7796  Returns:
7797  - true - The TransmitterInterruptMode feature is supported on the device
7798  - false - The TransmitterInterruptMode feature is not supported on the device
7799  Remarks:
7800  None.
7801 */
7802 
7803 bool
7805  USART_MODULE_ID index ) ;
7806 //******************************************************************************
7807 /* Function:
7808  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7809  Summary:
7810  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7811  Description:
7812  This function identifies whether the TransmitterIdleIsLow feature is available
7813  on the USART module. When this function returns true, these functions are
7814  supported on the device:
7815  - PLIB_USART_TransmitterIdleIsLowDisable
7816  - PLIB_USART_TransmitterIdleIsLowEnable
7817  This operation is atomic.
7818  Preconditions:
7819  None.
7820  Parameters:
7821  index - Identifier for the device instance
7822  Returns:
7823  - true - The TransmitterIdleIsLow feature is supported on the device
7824  - false - The TransmitterIdleIsLow feature is not supported on the device
7825  Remarks:
7826  None.
7827 */
7828 
7829 bool
7831  USART_MODULE_ID index ) ;
7832 //DOM-IGNORE-BEGIN
7833 //DOM-IGNORE-END
7834  // #ifndef _PLIB_USART_H
7835 /******************************************************************************
7836  End of File
7837 */
7838 
7839 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7840 /* CLOSE_FILE Include File */
7841 
7842 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7843 /*******************************************************************************
7844  System Services Library Interface Header
7845  Company:
7846  Microchip Technology Inc.
7847  File Name:
7848  system.h
7849  Summary:
7850  Top level common system services library interface header.
7851  Description:
7852  This file is the top level common system services library interface header.
7853  It defines (or includes files that define) the common system service
7854  types, prototypes, and other definitions that are commonly used by MPLAB
7855  Harmony libraries and system services.
7856 
7857  System services provide common functionality that would otherwise need to
7858  be duplicated by multiple other modules or that would force them to
7859  interact in complex and hard to manage ways. System services eliminate
7860  conflicts by controlling access shared resources.
7861  Remarks:
7862  The parent directory to the "system" directory should be added to the
7863  compiler's search path for header files such that the following include
7864  statment will successfully include this file.
7865 
7866 #include "system/system.h"
7867  *******************************************************************************/
7868 //DOM-IGNORE-BEGIN
7869 /*******************************************************************************
7870 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7871 Microchip licenses to you the right to use, modify, copy and distribute
7872 Software only when embedded on a Microchip microcontroller or digital signal
7873 controller that is integrated into your product or third party product
7874 (pursuant to the sublicense terms in the accompanying license agreement).
7875 You should refer to the license agreement accompanying this Software for
7876 additional information regarding your rights and obligations.
7877 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7878 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7879 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7880 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7881 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7882 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7883 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7884 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7885 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7886 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7887  *******************************************************************************/
7888 //DOM-IGNORE-END
7889 #ifndef _SYSTEM_H
7890 #define _SYSTEM_H
7891 // *****************************************************************************
7892 // *****************************************************************************
7893 // Section: Included Files
7894 // *****************************************************************************
7895 // *****************************************************************************
7896 #include "system/common/sys_common.h"
7897 #include "system/common/sys_module.h"
7898 // DOM-IGNORE-BEGIN
7899 // DOM-IGNORE-END
7900 //DOM-IGNORE-BEGIN
7901 //DOM-IGNORE-END
7902  // _SYSTEM_H
7903 /*******************************************************************************
7904  End of File
7905 */
7906 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7907 /* CLOSE_FILE Include File */
7908 
7909 #include "system/int/sys_int.h"
7910 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
7911 /*******************************************************************************
7912  DMA System Service Library Interface Definition
7913  Company:
7914  Microchip Technology Inc.
7915  File Name:
7916  sys_dma.h
7917  Summary:
7918  DMA System Service.
7919  Description:
7920  This file contains the interface definition for the DMA System
7921  Service. It provides a way to interact with the DMA subsystem to
7922  manage the data transfer between different peripherals and/or memory
7923  without intervention from the CPU.
7924 *******************************************************************************/
7925 //DOM-IGNORE-BEGIN
7926 /*******************************************************************************
7927 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7928 Microchip licenses to you the right to use, modify, copy and distribute
7929 Software only when embedded on a Microchip microcontroller or digital signal
7930 controller that is integrated into your product or third party product
7931 (pursuant to the sublicense terms in the accompanying license agreement).
7932 You should refer to the license agreement accompanying this Software for
7933 additional information regarding your rights and obligations.
7934 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7935 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7936 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7937 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7938 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7939 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7940 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7941 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7942 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7943 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7944 *******************************************************************************/
7945 //DOM-IGNORE-END
7946 #ifndef _SYS_DMA_H
7947 #define _SYS_DMA_H
7948 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
7949 /*******************************************************************************
7950  DMA System Service Library Interface Definition
7951  Company:
7952  Microchip Technology Inc.
7953  File Name:
7954  sys_dma_definitions.h
7955  Summary:
7956  DMA System Service data type definitions header.
7957  Description:
7958  This file contains data type definitions header.
7959 *******************************************************************************/
7960 //DOM-IGNORE-BEGIN
7961 /*******************************************************************************
7962 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7963 Microchip licenses to you the right to use, modify, copy and distribute
7964 Software only when embedded on a Microchip microcontroller or digital signal
7965 controller that is integrated into your product or third party product
7966 (pursuant to the sublicense terms in the accompanying license agreement).
7967 You should refer to the license agreement accompanying this Software for
7968 additional information regarding your rights and obligations.
7969 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7970 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7971 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7972 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7973 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7974 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7975 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7976 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7977 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7978 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7979 *******************************************************************************/
7980 //DOM-IGNORE-END
7981 #ifndef _SYS_DMA_DEFINITIONS_H
7982 #define _SYS_DMA_DEFINITIONS_H
7983 // *****************************************************************************
7984 // *****************************************************************************
7985 // Section: File includes
7986 // *****************************************************************************
7987 // *****************************************************************************
7988 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
7989 #include "system/common/sys_common.h"
7990 #include "system/common/sys_module.h"
7991 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
7992 /*******************************************************************************
7993  DMA Peripheral Library Interface Header
7994  Company:
7995  Microchip Technology Inc.
7996  File Name:
7997  plib_dma.h
7998  Summary:
7999  Defines the DMA Peripheral Library interface functions.
8000  Description:
8001  This header file contains the function prototypes and definitions of
8002  the data types and constants that make up the interface to the Direct Memory
8003  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8004  definitions in this file are for the DMA module.
8005 *******************************************************************************/
8006 // DOM-IGNORE-BEGIN
8007 /*******************************************************************************
8008 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8009 Microchip licenses to you the right to use, modify, copy and distribute
8010 Software only when embedded on a Microchip microcontroller or digital signal
8011 controller that is integrated into your product or third party product
8012 (pursuant to the sublicense terms in the accompanying license agreement).
8013 You should refer to the license agreement accompanying this Software for
8014 additional information regarding your rights and obligations.
8015 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8016 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8017 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8018 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8019 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8020 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8021 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8022 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8023 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8024 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8025 *******************************************************************************/
8026 // DOM-IGNORE-END
8027 #ifndef _PLIB_DMA_H
8028 #define _PLIB_DMA_H
8029 // DOM-IGNORE-BEGIN
8030 // DOM-IGNORE-END
8031 // *****************************************************************************
8032 // *****************************************************************************
8033 // Section: Includes
8034 // *****************************************************************************
8035 // *****************************************************************************
8036 /* See Bottom of file for implementation header include files.
8037 */
8038 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8039 //DOM-IGNORE-BEGIN
8040 /*******************************************************************************
8041 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8042 Microchip licenses to you the right to use, modify, copy and distribute
8043 Software only when embedded on a Microchip microcontroller or digital signal
8044 controller that is integrated into your product or third party product
8045 (pursuant to the sublicense terms in the accompanying license agreement).
8046 You should refer to the license agreement accompanying this Software for
8047 additional information regarding your rights and obligations.
8048 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8049 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8050 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8051 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8052 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8053 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8054 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8055 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8056 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8057 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8058  *******************************************************************************/
8059 //DOM-IGNORE-END
8060 #ifndef _PLIB_DMA_PROCESSOR_H
8061 #define _PLIB_DMA_PROCESSOR_H
8062 #error "Can't find header"
8063 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8064 /* CLOSE_FILE Include File */
8065 
8066 // *****************************************************************************
8067 // *****************************************************************************
8068 // Section: Peripheral Library Interface Functions
8069 // *****************************************************************************
8070 // *****************************************************************************
8071 // *****************************************************************************
8072 // *****************************************************************************
8073 // Section: DMA Channel Status Functions
8074 // *****************************************************************************
8075 // *****************************************************************************
8076 //******************************************************************************
8077 /* Function:
8078  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8079  DMA_CHANNEL channel )
8080  Summary:
8081  Returns the buffered data write status for the specified channel.
8082  Description:
8083  This function returns the buffered data write status for the specified channel.
8084  Precondition:
8085  None.
8086  Parameters:
8087  channel - One of the existing DMA channels listed by DMA_CHANNEL
8088  Returns:
8089  - true - The content of the DMA buffer has not been written to the location
8090  specified in the destination/source address or in Null Write mode
8091  - false - The content of the DMA buffer has been written to the location
8092  specified in the destination/source address or in Null Write mode
8093  Example:
8094  <code>
8095  bool chBuffWriteStatus;
8096  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8097  DMA_CHANNEL_3 );
8098  </code>
8099  Remarks:
8100  This feature is not available on all devices. Please refer to the specific device
8101  data sheet to determine availability.
8102 */
8103 
8104 bool
8106  DMA_MODULE_ID index ,
8107  DMA_CHANNEL channel ) ;
8108 /*******************************************************************************
8109  Function:
8110  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8111  DMA_CHANNEL channel,
8112  DMA_CHANNEL_COLLISION collisonType )
8113  Summary:
8114  Returns the status of the specified collision type for the specified channel.
8115  Description:
8116  This function returns the status of the specified collision type for the
8117  specified channel.
8118  Precondition:
8119  None.
8120  Parameters:
8121  channel - One of the existing DMA channels listed by DMA_CHANNEL
8122  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8123  Returns:
8124  - true - A collision specified by collisonType was detected
8125  - false - No collision of type collisonType was detected
8126  Example:
8127  <code>
8128  bool memWriteCollisionStatus;
8129  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8130  DMA_ID_0,
8131  DMA_CHANNEL_3,
8132  DMA_CHANNEL_COLLISION_MEMORY );
8133  </code>
8134  Remarks:
8135  This feature is not available on all devices. Please refer to the specific
8136  device data sheet to determine availability.
8137 */
8138 
8139 bool
8141  DMA_MODULE_ID index ,
8142  DMA_CHANNEL channel ,
8143  DMA_CHANNEL_COLLISION collisonType ) ;
8144 //******************************************************************************
8145 /* Function:
8146  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8147  DMA_CHANNEL channel )
8148  Summary:
8149  Returns the Ping-Pong mode status for the specified channel.
8150  Description:
8151  This function returns the Ping-Pong mode status for the specified channel.
8152  Precondition:
8153  None.
8154  Parameters:
8155  channel - One of the existing DMA channels listed by DMA_CHANNEL
8156  Returns:
8157  mode - One of the possible Ping-Pong modes
8158  Example:
8159  <code>
8160  DMA_PING_PONG_MODE chPingPongStatus;
8161  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8162  DMA_CHANNEL_3 );
8163  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8164  {
8165  \\Application
8166  }
8167  </code>
8168  Remarks:
8169  This feature is not available on all devices. Please refer to the specific
8170  device data sheet to determine availability.
8171 */
8172 
8173 DMA_PING_PONG_MODE
8175  DMA_MODULE_ID index ,
8176  DMA_CHANNEL channel ) ;
8177 //******************************************************************************
8178 /* Function:
8179  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8180  DMA_CHANNEL channel )
8181  Summary:
8182  Returns the event status on the specified channel.
8183  Description:
8184  This function returns the event status on the specified channel.
8185  Precondition:
8186  None.
8187  Parameters:
8188  channel - One of the possible DMA channels listed by DMA_CHANNEL
8189  Returns:
8190  - true - An event was detected
8191  - false - No events were detected
8192  Example:
8193  <code>
8194  bool channeleventStatus;
8195  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8196  DMA_CHANNEL_2 );
8197  </code>
8198  Remarks:
8199  This function implements an operation of the ChannelXEvent feature.
8200  This feature may not be available on all devices. Please refer to the
8201  specific device data sheet to determine availability or include the
8202  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8203  whether this feature is available.
8204 */
8205 
8206 bool
8208  DMA_MODULE_ID index ,
8209  DMA_CHANNEL channel ) ;
8210 // *****************************************************************************
8211 // *****************************************************************************
8212 // Section: DMA Channel Configuration Functions
8213 // *****************************************************************************
8214 // *****************************************************************************
8215 //******************************************************************************
8216 /* Function:
8217  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8218  DMA_CHANNEL channel,
8219  DMA_CHANNEL_PRIORITY channelPriority )
8220  Summary:
8221  Sets the priority of the specified channel.
8222  Description:
8223  This function sets the priority of the specified channel.
8224  Precondition:
8225  None.
8226  Parameters:
8227  channel - One of the existing DMA channels listed by DMA_CHANNEL
8228  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8229  Returns:
8230  None.
8231  Example:
8232  <code>
8233  DMA_CHANNEL channel = DMA_CHANNEL_0;
8234  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8235  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8236  </code>
8237  Remarks:
8238  This function implements an operation of the ChannelXPriority feature.
8239  This feature may not be available on all devices. Please refer to the
8240  specific device data sheet to determine availability or use the
8241  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8242  whether this feature is available.
8243 */
8244 
8245 void
8247  DMA_MODULE_ID index ,
8248  DMA_CHANNEL channel ,
8249  DMA_CHANNEL_PRIORITY channelPriority ) ;
8250 //******************************************************************************
8251 /* Function:
8252  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8253  DMA_CHANNEL channel )
8254  Summary:
8255  Gets the priority of the specified channel.
8256  Description:
8257  This function gets the priority of the specified channel.
8258  Precondition:
8259  None.
8260  Parameters:
8261  channel - One of the existing DMA channels listed by DMA_CHANNEL
8262  Returns:
8263  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8264  Example:
8265  <code>
8266  DMA_CHANNEL channel = DMA_CHANNEL_0;
8267  DMA_CHANNEL_PRIORITY channelPriority;
8268  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8269  </code>
8270  Remarks:
8271  This function implements an operation of the ChannelXPriority feature.
8272  This feature may not be available on all devices. Please refer to the
8273  specific device data sheet to determine availability or use the
8274  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8275  whether this feature is available.
8276 */
8277 
8278 DMA_CHANNEL_PRIORITY
8280  DMA_MODULE_ID index ,
8281  DMA_CHANNEL channel ) ;
8282 //******************************************************************************
8283 /* Function:
8284  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8285  DMA_CHANNEL_PRIORITY channelPriority )
8286  Summary:
8287  Sets the priority scheme of the DMA channels.
8288  Description:
8289  This function sets the priority scheme of the DMA channels at the global level.
8290  This function is used in devices that do not have the per channel priority feature.
8291  Precondition:
8292  None.
8293  Parameters:
8294  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8295  Returns:
8296  None.
8297  Example:
8298  <code>
8299  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8300  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8301  </code>
8302  Remarks:
8303  This feature is not available on all devices. Please refer to the specific
8304  device data sheet to determine availability.
8305 */
8306 
8307 void
8309  DMA_MODULE_ID index ,
8310  DMA_CHANNEL_PRIORITY channelPriority ) ;
8311 //******************************************************************************
8312 /* Function:
8313  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8314  Summary:
8315  Gets the priority scheme of the DMA channels.
8316  Description:
8317  This function gets the priority scheme of the DMA channels at the global level.
8318  This function is used in devices that do not have the per channel priority feature.
8319  Precondition:
8320  None.
8321  Parameters:
8322  None.
8323  Returns:
8324  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8325  Example:
8326  <code>
8327  DMA_CHANNEL_PRIORITY channelPriority;
8328  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8329  </code>
8330  Remarks:
8331  This feature is not available on all devices. Please refer to the specific
8332  device data sheet to determine availability.
8333 */
8334 
8335 DMA_CHANNEL_PRIORITY
8337  DMA_MODULE_ID index ) ;
8338 //******************************************************************************
8339 /* Function:
8340  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8341  DMA_CHANNEL channel )
8342  Summary:
8343  Channel is continuously enabled.
8344  Description:
8345  This function enables the channel continuously. The channel is not automatically
8346  disabled after a block transfer is complete.
8347  Precondition:
8348  None.
8349  Parameters:
8350  channel - One of the possible DMA channels listed by DMA_CHANNEL
8351  Returns:
8352  None.
8353  Example:
8354  <code>
8355  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8356  </code>
8357  Remarks:
8358  This function implements an operation of the ChannelXAuto feature.
8359  This feature may not be available on all devices. Please refer to the
8360  specific device data sheet to determine availability or use the
8361  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8362  whether this feature is available.
8363 */
8364 
8365 void
8367  DMA_MODULE_ID index ,
8368  DMA_CHANNEL channel ) ;
8369 //******************************************************************************
8370 /* Function:
8371  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8372  DMA_CHANNEL channel )
8373  Summary:
8374  Returns the channel automatic enable status.
8375  Description:
8376  This function returns the channel automatic enable status.
8377  Precondition:
8378  None.
8379  Parameters:
8380  channel - One of the possible DMA channels listed by DMA_CHANNEL
8381  Returns:
8382  - true - Channel automatic enable is on
8383  - false - Channel automatic enable is off
8384  Example:
8385  <code>
8386  bool ChAutoEnableStatus;
8387  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8388  </code>
8389  Remarks:
8390  This function implements an operation of the ChannelXAuto feature.
8391  This feature may not be available on all devices. Please refer to the
8392  specific device data sheet to determine availability or use the
8393  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8394  whether this feature is available.
8395 */
8396 
8397 bool
8399  DMA_MODULE_ID index ,
8400  DMA_CHANNEL channel ) ;
8401 //******************************************************************************
8402 /* Function:
8403  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8404  DMA_CHANNEL channel )
8405  Summary:
8406  Channel is disabled after a block transfer is complete.
8407  Description:
8408  This function disables a channel after a block transfer is complete.
8409  Precondition:
8410  None.
8411  Parameters:
8412  channel - One of the possible DMA channels listed by DMA_CHANNEL
8413  Returns:
8414  None.
8415  Example:
8416  <code>
8417  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8418  </code>
8419  Remarks:
8420  This function implements an operation of the ChannelXAuto feature.
8421  This feature may not be available on all devices. Please refer to the
8422  specific device data sheet to determine availability or use the
8423  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8424  whether this feature is available.
8425 */
8426 
8427 void
8429  DMA_MODULE_ID index ,
8430  DMA_CHANNEL channel ) ;
8431 //******************************************************************************
8432 /* Function:
8433  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8434  DMA_CHANNEL channel )
8435  Summary:
8436  Channel chain feature is enabled.
8437  Description:
8438  This function enables the channel chain feature.
8439  Precondition:
8440  None.
8441  Parameters:
8442  channel - One of the possible DMA channels listed by DMA_CHANNEL
8443  Returns:
8444  None.
8445  Example:
8446  <code>
8447  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8448  </code>
8449  Remarks:
8450  This function implements an operation of the ChannelXChainEnbl feature.
8451  This feature may not be available on all devices. Please refer to the
8452  specific device data sheet to determine availability or use the
8453  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8454  whether this feature is available.
8455 */
8456 
8457 void
8459  DMA_MODULE_ID index ,
8460  DMA_CHANNEL channel ) ;
8461 //******************************************************************************
8462 /* Function:
8463  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8464  DMA_CHANNEL channel )
8465  Summary:
8466  Returns the chain status of the specified channel.
8467  Description:
8468  This function returns the chain status of the specified channel.
8469  Precondition:
8470  None.
8471  Parameters:
8472  channel - One of the possible DMA channels listed by DMA_CHANNEL
8473  Returns:
8474  - true - The channel chain is on for this channel
8475  - false - The channel chain is off for this channel
8476  Example:
8477  <code>
8478  bool ChchainStatus;
8479  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8480  </code>
8481  Remarks:
8482  This function implements an operation of the ChannelXChainEnbl feature.
8483  This feature may not be available on all devices. Please refer to the
8484  specific device data sheet to determine availability or use the
8485  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8486  whether this feature is available.
8487 */
8488 
8489 bool
8491  DMA_MODULE_ID index ,
8492  DMA_CHANNEL channel ) ;
8493 //******************************************************************************
8494 /* Function:
8495  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8496  DMA_CHANNEL channel )
8497  Summary:
8498  Disables the channel chaining for the specified DMA channel.
8499  Description:
8500  This function disables the channel chaining for the specified DMA channel.
8501  Precondition:
8502  None.
8503  Parameters:
8504  channel - One of the possible DMA channels listed by DMA_CHANNEL
8505  Returns:
8506  None.
8507  Example:
8508  <code>
8509  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8510  </code>
8511  Remarks:
8512  This function implements an operation of the ChannelXChainEnbl feature.
8513  This feature may not be available on all devices. Please refer to the
8514  specific device data sheet to determine availability or use the
8515  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8516  whether this feature is available.
8517 */
8518 
8519 void
8521  DMA_MODULE_ID index ,
8522  DMA_CHANNEL channel ) ;
8523 //******************************************************************************
8524 /* Function:
8525  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8526  DMA_CHANNEL channel )
8527  Summary:
8528  Channel start/abort events will be registered even if the channel is
8529  disabled.
8530  Description:
8531  This function will allow the channel register start/abort events even if the
8532  channel is disabled.
8533  Precondition:
8534  None.
8535  Parameters:
8536  channel - One of the possible DMA channels listed by DMA_CHANNEL
8537  Returns:
8538  None.
8539  Example:
8540  <code>
8541  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8542  </code>
8543  Remarks:
8544  This function implements an operation of the ChannelXDisabled feature.
8545  This feature may not be available on all devices. Please refer to the
8546  specific device data sheet to determine availability or use the
8547  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8548  determine whether this feature is available.
8549 */
8550 
8551 void
8553  DMA_MODULE_ID index ,
8554  DMA_CHANNEL channel ) ;
8555 //******************************************************************************
8556 /* Function:
8557  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8558  DMA_CHANNEL channel )
8559  Summary:
8560  Channel start/abort events will be ignored even if the channel is
8561  disabled.
8562  Description:
8563  This function will allow the channel start/abort events to be ignored even if
8564  the channel is disabled.
8565  Precondition:
8566  None.
8567  Parameters:
8568  channel - One of the possible DMA channels listed by DMA_CHANNEL
8569  Returns:
8570  None.
8571  Example:
8572  <code>
8573  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8574  </code>
8575  Remarks:
8576  This function implements an operation of the ChannelXDisabled feature.
8577  This feature may not be available on all devices. Please refer to the
8578  specific device data sheet to determine availability or use the
8579  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8580  determine whether this feature is available.
8581 */
8582 
8583 void
8585  DMA_MODULE_ID index ,
8586  DMA_CHANNEL channel ) ;
8587 //******************************************************************************
8588 /* Function:
8589  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8590  DMA_CHANNEL channel )
8591  Summary:
8592  Enable the specified channel.
8593  Description:
8594  This function will enable the specified channel.
8595  Precondition:
8596  None.
8597  Parameters:
8598  channel - One of the possible DMA channels listed by DMA_CHANNEL
8599  Returns:
8600  None.
8601  Example:
8602  <code>
8603  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8604  </code>
8605  Remarks:
8606  This function implements an operation of the ChannelX feature.
8607  This feature may not be available on all devices. Please refer to the
8608  specific device data sheet to determine availability or use the
8609  PLIB_DMA_ExistsChannelX function in your application to automatically
8610  determine whether this feature is available.
8611 */
8612 
8613 void
8615  DMA_MODULE_ID index ,
8616  DMA_CHANNEL channel ) ;
8617 //******************************************************************************
8618 /* Function:
8619  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8620  DMA_CHANNEL channel )
8621  Summary:
8622  Return the enable status of the specified channel.
8623  Description:
8624  This function will return the enable status of the specified channel.
8625  Precondition:
8626  None.
8627  Parameters:
8628  channel - One of the possible DMA channels listed by DMA_CHANNEL
8629  Returns:
8630  - true - The specified DMA channel is enabled
8631  - false - The specified DMA channel is disabled
8632  Example:
8633  <code>
8634  bool chEnableStatus;
8635  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8636  </code>
8637  Remarks:
8638  This function implements an operation of the ChannelX feature.
8639  This feature may not be available on all devices. Please refer to the
8640  specific device data sheet to determine availability or use the
8641  PLIB_DMA_ExistsChannelX function in your application to automatically
8642  determine whether this feature is available.
8643 */
8644 
8645 bool
8647  DMA_MODULE_ID index ,
8648  DMA_CHANNEL channel ) ;
8649 //******************************************************************************
8650 /* Function:
8651  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8652  DMA_CHANNEL channel )
8653  Summary:
8654  Disable the specified channel.
8655  Description:
8656  This function will disable the specified channel.
8657  Precondition:
8658  None.
8659  Parameters:
8660  channel - One of the possible DMA channels listed by DMA_CHANNEL
8661  Returns:
8662  None.
8663  Example:
8664  <code>
8665  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8666  </code>
8667  Remarks:
8668  This function implements an operation of the ChannelX feature.
8669  This feature may not be available on all devices. Please refer to the
8670  specific device data sheet to determine availability or use the
8671  PLIB_DMA_ExistsChannelX function in your application to automatically
8672  determine whether this feature is available.
8673 */
8674 
8675 void
8677  DMA_MODULE_ID index ,
8678  DMA_CHANNEL channel ) ;
8679 //******************************************************************************
8680 /* Function:
8681  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8682  DMA_CHANNEL channel )
8683  Summary:
8684  Chains the specified channel to a channel lower in natural priority.
8685  Description:
8686  This function will chain the specified channel to a channel lower in
8687  natural priority. CH3 will be enabled by a CH4 transfer complete.
8688  Precondition:
8689  None.
8690  Parameters:
8691  channel - One of the possible DMA channels listed by DMA_CHANNEL
8692  Returns:
8693  None.
8694  Example:
8695  <code>
8696  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8697  </code>
8698  Remarks:
8699  This function implements an operation of the ChannelXChain feature.
8700  This feature may not be available on all devices. Please refer to the
8701  specific device data sheet to determine availability or use the
8702  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8703  determine whether this feature is available.
8704 */
8705 
8706 void
8708  DMA_MODULE_ID index ,
8709  DMA_CHANNEL channel ) ;
8710 //******************************************************************************
8711 /* Function:
8712  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8713  DMA_CHANNEL channel )
8714  Summary:
8715  Chains the specified channel to a channel higher in natural priority.
8716  Description:
8717  This function will chain the specified channel to a channel higher in
8718  natural priority. CH5 will be enabled by a CH4 transfer complete.
8719  Precondition:
8720  None.
8721  Parameters:
8722  channel - One of the possible DMA channels listed by DMA_CHANNEL
8723  Returns:
8724  None.
8725  Example:
8726  <code>
8727  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8728  </code>
8729  Remarks:
8730  This function implements an operation of the ChannelXChain feature.
8731  This feature may not be available on all devices. Please refer to the
8732  specific device data sheet to determine availability or use the
8733  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8734  determine whether this feature is available.
8735 */
8736 
8737 void
8739  DMA_MODULE_ID index ,
8740  DMA_CHANNEL channel ) ;
8741 //******************************************************************************
8742 /* Function:
8743  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8744  DMA_CHANNEL channel )
8745  Summary:
8746  Sets the Busy bit to active.
8747  Description:
8748  This function sets the Busy bit to active, indicating the channel is active
8749  or has been enabled.
8750  Precondition:
8751  None.
8752  Parameters:
8753  channel - One of the possible DMA channels listed by DMA_CHANNEL
8754  Returns:
8755  None.
8756  Example:
8757  <code>
8758  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8759  </code>
8760  Remarks:
8761  This function implements an operation of the ChannelXBusy feature.
8762  This feature may not be available on all devices. Please refer to the
8763  specific device data sheet to determine availability or use the
8764  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8765  determine whether this feature is available.
8766 */
8767 
8768 void
8770  DMA_MODULE_ID index ,
8771  DMA_CHANNEL channel ) ;
8772 //******************************************************************************
8773 /* Function:
8774  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8775  DMA_CHANNEL channel )
8776  Summary:
8777  Sets the Busy bit to inactive.
8778  Description:
8779  This function sets the Busy bit to inactive, indicating the channel is inactive
8780  or has been disabled.
8781  Precondition:
8782  None.
8783  Parameters:
8784  channel - One of the possible DMA channels listed by DMA_CHANNEL
8785  Returns:
8786  None.
8787  Example:
8788  <code>
8789  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8790  </code>
8791  Remarks:
8792  This function implements an operation of the ChannelXBusy feature.
8793  This feature may not be available on all devices. Please refer to the
8794  specific device data sheet to determine availability or use the
8795  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8796  determine whether this feature is available.
8797 */
8798 
8799 void
8801  DMA_MODULE_ID index ,
8802  DMA_CHANNEL channel ) ;
8803 //******************************************************************************
8804 /* Function:
8805  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8806  DMA_CHANNEL channel )
8807  Summary:
8808  Returns the busy status of the specified channel.
8809  Description:
8810  This function returns the busy status of the specified channel.
8811  Precondition:
8812  None.
8813  Parameters:
8814  channel - One of the possible DMA channels listed by DMA_CHANNEL
8815  Returns:
8816  - true - The channel is active or has been enabled
8817  - false - The channel is inactive or has been disabled
8818  Example:
8819  <code>
8820  bool chBusyStatus;
8821  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8822  </code>
8823  Remarks:
8824  This function implements an operation of the ChannelXBusy feature.
8825  This feature may not be available on all devices. Please refer to the
8826  specific device data sheet to determine availability or use the
8827  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8828  determine whether this feature is available.
8829 */
8830 
8831 bool
8833  DMA_MODULE_ID index ,
8834  DMA_CHANNEL channel ) ;
8835 //******************************************************************************
8836 /* Function:
8837  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8838  DMA_CHANNEL channel,
8839  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8840  Summary:
8841  Selects the data transfer direction of the specified channel.
8842  Description:
8843  This function selects the data transfer direction of the specified channel.
8844  Precondition:
8845  None.
8846  Parameters:
8847  channel - One of the possible DMA channels listed by DMA_CHANNEL
8848  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8849  Returns:
8850  None.
8851  Example:
8852  <code>
8853  PLIB_DMA_ChannelXTransferDirectionSelect (
8854  DMA_ID_0,
8855  DMA_CHANNEL_4,
8856  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8857  </code>
8858  Remarks:
8859  This feature is not available on all devices. Please refer to the specific
8860  device data sheet to determine availability.
8861 */
8862 
8863 void
8865  DMA_MODULE_ID index ,
8866  DMA_CHANNEL channel ,
8867  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8868 //******************************************************************************
8869 /* Function:
8870  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8871  DMA_MODULE_ID index,
8872  DMA_CHANNEL channel)
8873  Summary:
8874  Returns the data transfer direction of the specified channel.
8875  Description:
8876  This function returns the data transfer direction of the specified channel.
8877  Precondition:
8878  None.
8879  Parameters:
8880  channel - One of the possible DMA channels listed by DMA_CHANNEL
8881  Returns:
8882  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8883  DMA_CHANNEL_TRANSFER_DIRECTION
8884  Example:
8885  <code>
8886  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8887  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8888  DMA_ID_0,
8889  DMA_CHANNEL_4 );
8890  </code>
8891  Remarks:
8892  This feature is not available on all devices. Please refer to the specific
8893  device data sheet to determine availability.
8894 */
8895 
8896 DMA_CHANNEL_TRANSFER_DIRECTION
8898  DMA_MODULE_ID index ,
8899  DMA_CHANNEL channel ) ;
8900 //******************************************************************************
8901 /* Function:
8902  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8903  DMA_CHANNEL channel ,
8904  uint16_t address,
8905  DMA_ADDRESS_OFFSET_TYPE offset )
8906  Summary:
8907  Sets the primary/secondary start address (DPSRAM) offset to the value
8908  specified depending on the offset type specified for the specified channel.
8909  Description:
8910  This function sets the primary/secondary start address (DPSRAM) offset to the value
8911  specified depending on the offset type specified for the specified channel.
8912  Precondition:
8913  None.
8914  Parameters:
8915  channel - One of the possible DMA channels listed by DMA_CHANNEL
8916  address - The primary/secondary DPSRAM start address offset
8917  offset - The type of the address offset (primary/secondary)
8918  Returns:
8919  None.
8920  Example:
8921  <code>
8922  uint16_t address = 0x100;
8923  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
8924  DMA_CHANNEL_4,
8925  address,
8926  DMA_ADDRESS_OFFSET_PRIMARY );
8927  </code>
8928  Remarks:
8929  This feature is not available on all devices. Please refer to the specific
8930  device data sheet to determine availability.
8931 */
8932 
8933 void
8935  DMA_MODULE_ID index ,
8936  DMA_CHANNEL channel ,
8937  uint16_t address ,
8938  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8939 //******************************************************************************
8940 /* Function:
8941  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
8942  DMA_CHANNEL channel,
8943  DMA_ADDRESS_OFFSET_TYPE offset)
8944  Summary:
8945  Gets the primary/secondary start address (DPSRAM) offset.
8946  Description:
8947  This function gets the primary/secondary start address (DPSRAM) offset.
8948  Precondition:
8949  None.
8950  Parameters:
8951  channel - One of the possible DMA channels listed by DMA_CHANNEL
8952  offset - The type of the address offset (primary/secondary)
8953  Returns:
8954  - uint16_t - The primary/secondary DPSRAM start address offset
8955  Example:
8956  <code>
8957  uint16_t addressOffsetA;
8958  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
8959  DMA_ID_0,
8960  DMA_CHANNEL_4,
8961  address,
8962  DMA_ADDRESS_OFFSET_PRIMARY );
8963  </code>
8964  Remarks:
8965  This feature is not available on all devices. Please refer to the specific
8966  device data sheet to determine availability.
8967 */
8968 
8969 uint16_t
8971  DMA_MODULE_ID index ,
8972  DMA_CHANNEL channel ,
8973  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8974 //******************************************************************************
8975 /* Function:
8976  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
8977  DMA_CHANNEL channel ,
8978  uint16_t peripheraladdress )
8979  Summary:
8980  Sets the peripheral address for the specified channel.
8981  Description:
8982  This function sets the peripheral address for the specified channel.
8983  Precondition:
8984  None.
8985  Parameters:
8986  channel - One of the possible DMA channels listed by DMA_CHANNEL
8987  peripheraladdress - The peripheral address for the specified channel
8988  Returns:
8989  None.
8990  Example:
8991  <code>
8992  uint16_t peripheraladdress = 0x100;
8993  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
8994  DMA_CHANNEL_4,
8995  peripheraladdress );
8996  </code>
8997  Remarks:
8998  This feature is not available on all devices. Please refer to the specific
8999  device data sheet to determine availability.
9000 */
9001 
9002 void
9004  DMA_MODULE_ID index ,
9005  DMA_CHANNEL channel ,
9006  uint16_t peripheraladdress ) ;
9007 //******************************************************************************
9008 /* Function:
9009  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9010  DMA_CHANNEL channel )
9011  Summary:
9012  Gets the peripheral address configured for the specified channel.
9013  Description:
9014  This function gets the peripheral address configured for the specified channel.
9015  Precondition:
9016  None.
9017  Parameters:
9018  channel - One of the possible DMA channels listed by DMA_CHANNEL
9019  Returns:
9020  - uint16_t - The peripheral address configured for the specified channel
9021  Example:
9022  <code>
9023  uint16_t peripheraladdress;
9024  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9025  DMA_CHANNEL_4 );
9026  </code>
9027  Remarks:
9028  This feature is not available on all devices. Please refer to the specific
9029  device data sheet to determine availability.
9030 */
9031 
9032 uint16_t
9034  DMA_MODULE_ID index ,
9035  DMA_CHANNEL channel ) ;
9036 //******************************************************************************
9037 /* Function:
9038  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9039  DMA_CHANNEL channel ,
9040  uint16_t transferCount )
9041  Summary:
9042  Sets the DMA data transfer count for the specified channel.
9043  Description:
9044  This function sets the DMA data transfer count for the specified channel.
9045  Precondition:
9046  None.
9047  Parameters:
9048  channel - One of the possible DMA channels listed by DMA_CHANNEL
9049  transferCount - The DMA transfer count for the channel
9050  Returns:
9051  None.
9052  Example:
9053  <code>
9054  uint16_t transferCount = 0x10;
9055  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9056  DMA_CHANNEL_4,
9057  transferCount );
9058  </code>
9059  Remarks:
9060  This feature is not available on all devices. Please refer to the specific
9061  device data sheet to determine availability.
9062 */
9063 
9064 void
9066  DMA_MODULE_ID index ,
9067  DMA_CHANNEL channel ,
9068  uint16_t transferCount ) ;
9069 //******************************************************************************
9070 /* Function:
9071  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9072  DMA_CHANNEL channel )
9073  Summary:
9074  Gets the DMA data transfer count that is programmed for the specified channel.
9075  Description:
9076  This function gets the DMA data transfer count that is programmed for the specified channel.
9077  Precondition:
9078  None.
9079  Parameters:
9080  channel - One of the possible DMA channels listed by DMA_CHANNEL
9081  Returns:
9082  - uint16_t - The DMA transfer count for the channel
9083  Example:
9084  <code>
9085  uint16_t transferCount;
9086  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9087  DMA_CHANNEL_4 );
9088  </code>
9089  Remarks:
9090  This feature is not available on all devices. Please refer to the specific
9091  device data sheet to determine availability.
9092 */
9093 
9094 uint16_t
9096  DMA_MODULE_ID index ,
9097  DMA_CHANNEL channel ) ;
9098 //******************************************************************************
9099 /* Function:
9100  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9101  DMA_MODULE_ID index,
9102  DMA_CHANNEL channel,
9103  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9104  Summary:
9105  Sets the source address mode of the specified channel.
9106  Description:
9107  This function sets the source address mode of the specified channel.
9108  Precondition:
9109  None.
9110  Parameters:
9111  channel - One of the possible DMA channels listed by DMA_CHANNEL
9112  sourceAddressMode - One of the possible source addressing modes listed by
9113  DMA_SOURCE_ADDRESSING_MODE
9114  Returns:
9115  None.
9116  Example:
9117  <code>
9118  PLIB_DMA_ChannelXSourceAddressModeSelect (
9119  DMA_ID_0,
9120  DMA_CHANNEL_4,
9121  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9122  </code>
9123  Remarks:
9124  This feature is not available on all devices. Please refer to the specific
9125  device data sheet to determine availability.
9126 */
9127 
9128 void
9130  DMA_MODULE_ID index ,
9131  DMA_CHANNEL channel ,
9132  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9133 //******************************************************************************
9134 /* Function:
9135  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9136  DMA_MODULE_ID index,
9137  DMA_CHANNEL channel )
9138  Summary:
9139  Gets the source address mode of the specified channel.
9140  Description:
9141  This function gets the source address mode of the specified channel.
9142  Precondition:
9143  None.
9144  Parameters:
9145  channel - One of the possible DMA channels listed by DMA_CHANNEL
9146  Returns:
9147  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9148  listed by DMA_SOURCE_ADDRESSING_MODE
9149  Example:
9150  <code>
9151  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9152  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9153  DMA_CHANNEL_4 );
9154  </code>
9155  Remarks:
9156  This feature is not available on all devices. Please refer to the specific
9157  device data sheet to determine availability.
9158 */
9159 
9160 DMA_SOURCE_ADDRESSING_MODE
9162  DMA_MODULE_ID index ,
9163  DMA_CHANNEL channel ) ;
9164 //******************************************************************************
9165 /* Function:
9166  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9167  DMA_MODULE_ID index,
9168  DMA_CHANNEL channel,
9169  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9170  Summary:
9171  Sets the source address mode of the specified channel.
9172  Description:
9173  This function Sets the source address mode of the specified channel.
9174  Precondition:
9175  None.
9176  Parameters:
9177  channel - One of the possible DMA channels listed by DMA_CHANNEL
9178  destinationAddressMode - One of the possible source addressing modes listed by
9179  DMA_DESTINATION_ADDRESSING_MODE
9180  Returns:
9181  None.
9182  Example:
9183  <code>
9184  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9185  DMA_ID_0,
9186  DMA_CHANNEL_4,
9187  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9188  </code>
9189  Remarks:
9190  This feature is not available on all devices. Please refer to the specific
9191  device data sheet to determine availability.
9192 */
9193 
9194 void
9196  DMA_MODULE_ID index ,
9197  DMA_CHANNEL channel ,
9198  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9199 //******************************************************************************
9200 /* Function:
9201  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9202  DMA_MODULE_ID index,
9203  DMA_CHANNEL channel )
9204  Summary:
9205  Gets the source address mode of the specified channel.
9206  Description:
9207  This function gets the source address mode of the specified channel.
9208  Precondition:
9209  None.
9210  Parameters:
9211  channel - One of the possible DMA channels listed by DMA_CHANNEL
9212  Returns:
9213  - destinationAddressMode - One of the possible source addressing modes listed by
9214  DMA_DESTINATION_ADDRESSING_MODE
9215  Example:
9216  <code>
9217  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9218  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9219  DMA_ID_0,
9220  DMA_CHANNEL_4 );
9221  </code>
9222  Remarks:
9223  This feature is not available on all devices. Please refer to the specific
9224  device data sheet to determine availability.
9225 */
9226 
9227 DMA_DESTINATION_ADDRESSING_MODE
9229  DMA_MODULE_ID index ,
9230  DMA_CHANNEL channel ) ;
9231 //******************************************************************************
9232 /* Function:
9233  void PLIB_DMA_ChannelXAddressModeSelect (
9234  DMA_MODULE_ID index,
9235  DMA_CHANNEL channel,
9236  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9237  Summary:
9238  Sets the channel address mode.
9239  Description:
9240  This function sets the channel address mode.
9241  Precondition:
9242  None.
9243  Parameters:
9244  channel - One of the possible DMA channels listed by DMA_CHANNEL
9245  channelAddressMode - One of the possible channel addressing modes listed by
9246  DMA_CHANNEL_ADDRESSING_MODE
9247  Returns:
9248  None.
9249  Example:
9250  <code>
9251  PLIB_DMA_ChannelXAddressModeSelect (
9252  DMA_ID_0,
9253  DMA_CHANNEL_4,
9254  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9255  </code>
9256  Remarks:
9257  This feature is not available on all devices. Please refer to the specific
9258  device data sheet to determine availability.
9259 */
9260 
9261 void
9263  DMA_MODULE_ID index ,
9264  DMA_CHANNEL channel ,
9265  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9266 //******************************************************************************
9267 /* Function:
9268  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9269  DMA_MODULE_ID index,
9270  DMA_CHANNEL channel )
9271  Summary:
9272  Gets the channel address mode.
9273  Description:
9274  This function gets the channel address mode.
9275  Precondition:
9276  None.
9277  Parameters:
9278  channel - One of the possible DMA channels listed by DMA_CHANNEL
9279  Returns:
9280  - channelAddressMode - One of the possible source addressing modes listed by
9281  DMA_CHANNEL_ADDRESSING_MODE
9282  Example:
9283  <code>
9284  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9285  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9286  DMA_CHANNEL_4 );
9287  </code>
9288  Remarks:
9289  This feature is not available on all devices. Please refer to the specific
9290  device data sheet to determine availability.
9291 */
9292 
9293 DMA_CHANNEL_ADDRESSING_MODE
9295  DMA_MODULE_ID index ,
9296  DMA_CHANNEL channel ) ;
9297 // *****************************************************************************
9298 // *****************************************************************************
9299 // Section: DMA Channel Event Configuration functions
9300 // *****************************************************************************
9301 // *****************************************************************************
9302 //******************************************************************************
9303 /* Function:
9304  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9305  DMA_CHANNEL channel,
9306  DMA_CHANNEL_TRIGGER_TYPE trigger )
9307  Summary:
9308  Enables the specified DMA channel trigger.
9309  Description:
9310  This function enables the specified DMA channel trigger.
9311  Precondition:
9312  None.
9313  Parameters:
9314  channel - One of the possible DMA channels listed by DMA_CHANNEL
9315  trigger - Type of trigger (transfer start/abort/pattern match abort)
9316  Returns:
9317  None.
9318  Example:
9319  <code>
9320  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9321  DMA_CHANNEL_4,
9322  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9323  </code>
9324  Remarks:
9325  This function implements an operation of the ChannelXTrigger feature.
9326  This feature may not be available on all devices. Please refer to the
9327  specific device data sheet to determine availability or use the
9328  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9329  determine whether this feature is available.
9330 */
9331 
9332 void
9334  DMA_MODULE_ID index ,
9335  DMA_CHANNEL channel ,
9336  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9337 //******************************************************************************
9338 /* Function:
9339  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9340  DMA_CHANNEL channel,
9341  DMA_CHANNEL_TRIGGER_TYPE trigger )
9342  Summary:
9343  Returns the enable status of the specified DMA transfer/abort trigger.
9344  Description:
9345  This function returns the enable status of the specified DMA transfer/abort trigger.
9346  Precondition:
9347  None.
9348  Parameters:
9349  channel - One of the possible DMA channels listed by DMA_CHANNEL
9350  trigger - Type of trigger (transfer start/abort/pattern match abort)
9351  Returns:
9352  - true - The specified trigger is enabled
9353  - false - The specified trigger is disabled
9354  Example:
9355  <code>
9356  bool startTriggerstatus;
9357  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9358  DMA_ID_0,
9359  DMA_CHANNEL_4,
9360  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9361  </code>
9362  Remarks:
9363  This function implements an operation of the ChannelXTrigger feature.
9364  This feature may not be available on all devices. Please refer to the
9365  specific device data sheet to determine availability or use the
9366  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9367  determine whether this feature is available.
9368 */
9369 
9370 bool
9372  DMA_MODULE_ID index ,
9373  DMA_CHANNEL channel ,
9374  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9375 //******************************************************************************
9376 /* Function:
9377  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9378  DMA_CHANNEL channel,
9379  DMA_CHANNEL_TRIGGER_TYPE trigger )
9380  Summary:
9381  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9382  Description:
9383  This function disables the DMA transfer abort via a matching interrupt
9384  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9385  a transfer.
9386  Precondition:
9387  None.
9388  Parameters:
9389  channel - One of the possible DMA channels listed by DMA_CHANNEL
9390  trigger - Type of trigger (transfer start/abort/pattern match abort)
9391  Returns:
9392  None.
9393  Example:
9394  <code>
9395  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9396  DMA_CHANNEL_4,
9397  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9398  </code>
9399  Remarks:
9400  This function implements an operation of the ChannelXTrigger feature.
9401  This feature may not be available on all devices. Please refer to the
9402  specific device data sheet to determine availability or use the
9403  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9404  determine whether this feature is available.
9405 */
9406 
9407 void
9409  DMA_MODULE_ID index ,
9410  DMA_CHANNEL channel ,
9411  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9412 //******************************************************************************
9413 /* Function:
9414  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9415  DMA_CHANNEL channel)
9416  Summary:
9417  Gets the source number for the DMA channel interrupts.
9418  Description:
9419  This function returns the interrupt source number for the specified
9420  DMA channel.
9421  Precondition:
9422  None.
9423  Parameters:
9424  channel - One of the possible DMA channels listed by DMA_CHANNEL
9425  Returns:
9426  None.
9427  Example:
9428  <code>
9429  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9430  DMA_CHANNEL_4);
9431  </code>
9432  Remarks:
9433  This function implements an operation of the ChannelXTrigger feature.
9434  This feature may not be available on all devices. Please refer to the
9435  specific device data sheet to determine availability or use the
9436  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9437  determine whether this feature is available.
9438 */
9439 
9440 DMA_CHANNEL_INT_SOURCE
9442  DMA_MODULE_ID index ,
9443  DMA_CHANNEL channel ) ;
9444 //******************************************************************************
9445 /* Function:
9446  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9447  DMA_CHANNEL channel,
9448  DMA_TRIGGER_SOURCE IRQnum )
9449  Summary:
9450  Sets the IRQ to initiate the DMA transfer on the specified channel.
9451  Description:
9452  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9453  (IRQ to start the channel transfer.)
9454  Precondition:
9455  None.
9456  Parameters:
9457  channel - One of the possible DMA channels listed by DMA_CHANNEL
9458  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9459  Returns:
9460  None.
9461  Example:
9462  <code>
9463  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9464  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9465  DMA_CHANNEL_4,
9466  irq );
9467  </code>
9468  Remarks:
9469  This function implements an operation of the ChannelXStartIRQ feature.
9470  This feature may not be available on all devices. Please refer to the
9471  specific device data sheet to determine availability or use the
9472  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9473  determine whether this feature is available.
9474 */
9475 
9476 void
9478  DMA_MODULE_ID index ,
9479  DMA_CHANNEL channel ,
9480  DMA_TRIGGER_SOURCE IRQnum ) ;
9481 //******************************************************************************
9482 /* Function:
9483  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9484  DMA_CHANNEL channel,
9485  DMA_TRIGGER_SOURCE IRQ )
9486  Summary:
9487  Sets the IRQ to abort the DMA transfer on the specified channel.
9488  Description:
9489  This function sets the IRQ to abort the DMA transfer on the specified channel.
9490  (IRQ to start the channel transfer.)
9491  Precondition:
9492  None.
9493  Parameters:
9494  channel - One of the possible DMA channels listed by DMA_CHANNEL
9495  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9496  Returns:
9497  None.
9498  Example:
9499  <code>
9500  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9501  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9502  DMA_CHANNEL_4,
9503  irq );
9504  </code>
9505  Remarks:
9506  This function implements an operation of the ChannelXAbortIRQ feature.
9507  This feature may not be available on all devices. Please refer to the
9508  specific device data sheet to determine availability or use the
9509  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9510  determine whether this feature is available.
9511 */
9512 
9513 void
9515  DMA_MODULE_ID index ,
9516  DMA_CHANNEL channel ,
9517  DMA_TRIGGER_SOURCE IRQ ) ;
9518 //******************************************************************************
9519 /* Function:
9520  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9521  DMA_CHANNEL channel,
9522  DMA_CHANNEL_DATA_SIZE channelDataSize )
9523  Summary:
9524  Selects the data size for the specified channel.
9525  Description:
9526  This function selects the data size for the specified channel.
9527  Precondition:
9528  None.
9529  Parameters:
9530  channel - One of the possible DMA channels listed by DMA_CHANNEL
9531  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9532  Returns:
9533  None.
9534  Example:
9535  <code>
9536  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9537  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9538  DMA_CHANNEL_4,
9539  channelDataSize );
9540  </code>
9541  Remarks:
9542  This feature is not available on all devices. Please refer to the specific
9543  device data sheet to determine availability.
9544 */
9545 
9546 void
9548  DMA_MODULE_ID index ,
9549  DMA_CHANNEL channel ,
9550  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9551 //******************************************************************************
9552 /* Function:
9553  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9554  DMA_CHANNEL channel )
9555  Summary:
9556  Returns the current data size for the specified channel.
9557  Description:
9558  This function returns the current data size for the specified channel.
9559  Precondition:
9560  None.
9561  Parameters:
9562  channel - One of the possible DMA channels listed by DMA_CHANNEL
9563  Returns:
9564  - channelDataSize - One of the possible data sizes listed by
9565  DMA_CHANNEL_DATA_SIZE
9566  Example:
9567  <code>
9568  DMA_CHANNEL_DATA_SIZE channelDataSize;
9569  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9570  DMA_CHANNEL_4 );
9571  </code>
9572  Remarks:
9573  This feature is not available on all devices. Please refer to the specific
9574  device data sheet to determine availability.
9575 */
9576 
9577 DMA_CHANNEL_DATA_SIZE
9579  DMA_MODULE_ID index ,
9580  DMA_CHANNEL channel ) ;
9581 //******************************************************************************
9582 /* Function:
9583  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9584  DMA_MODULE_ID index,
9585  DMA_CHANNEL channel,
9586  DMA_TRANSFER_MODE channeltransferMode )
9587  Summary:
9588  Selects the transfer/operating mode for the specified channel.
9589  Description:
9590  This function selects the transfer/operating mode for the specified channel.
9591  (Transfer mode and operating mode are used interchangeably.)
9592  Precondition:
9593  None.
9594  Parameters:
9595  channel - One of the possible DMA channels listed by DMA_CHANNEL
9596  channeltransferMode - One of the possible operating/transfer modes listed by
9597  DMA_TRANSFER_MODE
9598  Returns:
9599  None.
9600  Example:
9601  <code>
9602  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9603  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9604  DMA_CHANNEL_4,
9605  channeltransferMode );
9606  </code>
9607  Remarks:
9608  This feature is not available on all devices. Please refer to the specific
9609  device data sheet to determine availability.
9610 */
9611 
9612 void
9614  DMA_MODULE_ID index ,
9615  DMA_CHANNEL channel ,
9616  DMA_TRANSFER_MODE channeltransferMode ) ;
9617 //******************************************************************************
9618 /* Function:
9619  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9620  DMA_MODULE_ID index,
9621  DMA_CHANNEL channel )
9622  Summary:
9623  Returns the current transfer/operating mode for the specified channel.
9624  Description:
9625  This function returns the current transfer/operating mode for the specified channel.
9626  (Transfer mode and operating mode are used interchangeably.)
9627  Precondition:
9628  None.
9629  Parameters:
9630  channel - One of the possible DMA channels listed by DMA_CHANNEL
9631  Returns:
9632  - channeltransferMode - One of the possible operating/transfer modes listed
9633  by DMA_TRANSFER_MODE
9634  Example:
9635  <code>
9636  DMA_TRANSFER_MODE channeltransferMode;
9637  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9638  DMA_ID_0,
9639  DMA_CHANNEL_4 );
9640  </code>
9641  Remarks:
9642  This feature is not available on all devices. Please refer to the specific
9643  device data sheet to determine availability.
9644 */
9645 
9646 DMA_TRANSFER_MODE
9648  DMA_MODULE_ID index ,
9649  DMA_CHANNEL channel ) ;
9650 //******************************************************************************
9651 /* Function:
9652  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9653  DMA_CHANNEL channel )
9654  Summary:
9655  Enables reloading of the address and count registers.
9656  Description:
9657  This function enables reloading of the address and count registers. The source,
9658  destination address, and the DMA count registers are reloaded to their previous
9659  values upon the start of the next operation.
9660  Precondition:
9661  None.
9662  Parameters:
9663  channel - One of the possible DMA channels listed by DMA_CHANNEL
9664  Returns:
9665  None.
9666  Example:
9667  <code>
9668  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9669  DMA_CHANNEL_4 );
9670  </code>
9671  Remarks:
9672  This feature is not available on all devices. Please refer to the specific
9673  device data sheet to determine availability.
9674 */
9675 
9676 void
9678  DMA_MODULE_ID index ,
9679  DMA_CHANNEL channel ) ;
9680 //******************************************************************************
9681 /* Function:
9682  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9683  DMA_CHANNEL channel )
9684  Summary:
9685  Returns the address and count registers reload enable status.
9686  Description:
9687  This function returns the address and count registers reload enable status.
9688  Precondition:
9689  None.
9690  Parameters:
9691  channel - One of the possible DMA channels listed by DMA_CHANNEL
9692  Returns:
9693  - true - The address and count registers reload is enabled
9694  - false - The address and count registers reload is disabled
9695  Example:
9696  <code>
9697  bool chAddressCountReloadStatus;
9698  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9699  DMA_ID_0,
9700  DMA_CHANNEL_4 );
9701  </code>
9702  Remarks:
9703  This feature is not available on all devices. Please refer to the specific
9704  device data sheet to determine availability.
9705 */
9706 
9707 bool
9709  DMA_MODULE_ID index ,
9710  DMA_CHANNEL channel ) ;
9711 //******************************************************************************
9712 /* Function:
9713  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9714  DMA_CHANNEL channel )
9715  Summary:
9716  Disables reloading of the address and count registers.
9717  Description:
9718  This function disables reloading of the address and count registers. The source, destination
9719  address, and the DMA count registers are not reloaded to their previous values upon
9720  the start of the next operation.
9721  Precondition:
9722  None.
9723  Parameters:
9724  channel - One of the possible DMA channels listed by DMA_CHANNEL
9725  Returns:
9726  None.
9727  Example:
9728  <code>
9729  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9730  DMA_CHANNEL_4 );
9731  </code>
9732  Remarks:
9733  This feature is not available on all devices. Please refer to the specific
9734  device data sheet to determine availability.
9735 */
9736 
9737 void
9739  DMA_MODULE_ID index ,
9740  DMA_CHANNEL channel ) ;
9741 //******************************************************************************
9742 /* Function:
9743  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9744  DMA_CHANNEL channel )
9745  Summary:
9746  Enables the Null Write mode.
9747  Description:
9748  This function enables the Null Write mode. A dummy write is initiated to the
9749  source address for every write to the destination address.
9750  Precondition:
9751  None.
9752  Parameters:
9753  channel - One of the possible DMA channels listed by DMA_CHANNEL
9754  Returns:
9755  None.
9756  Example:
9757  <code>
9758  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9759  DMA_CHANNEL_4 );
9760  </code>
9761  Remarks:
9762  This feature is not available on all devices. Please refer to the specific
9763  device data sheet to determine availability.
9764 */
9765 
9766 void
9768  DMA_MODULE_ID index ,
9769  DMA_CHANNEL channel ) ;
9770 //******************************************************************************
9771 /* Function:
9772  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9773  DMA_CHANNEL channel )
9774  Summary:
9775  Returns the enable status of the Null Write mode for the specified channel.
9776  Description:
9777  This function returns the enable status of the Null Write mode for the specified channel.
9778  Precondition:
9779  None.
9780  Parameters:
9781  channel - One of the possible DMA channels listed by DMA_CHANNEL
9782  Returns:
9783  - true - Null write mode is enabled for this channel
9784  - false - Null write mode is disabled for this channel
9785  Example:
9786  <code>
9787  bool chNullWriteStatus;
9788  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9789  DMA_ID_0,
9790  DMA_CHANNEL_4 );
9791  </code>
9792  Remarks:
9793  This feature is not available on all devices. Please refer to the specific
9794  device data sheet to determine availability.
9795 */
9796 
9797 bool
9799  DMA_MODULE_ID index ,
9800  DMA_CHANNEL channel ) ;
9801 //******************************************************************************
9802 /* Function:
9803  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9804  DMA_CHANNEL channel )
9805  Summary:
9806  Disables the Null Write mode.
9807  Description:
9808  This function disables the Null Write mode. No dummy write is initiated.
9809  Precondition:
9810  None.
9811  Parameters:
9812  channel - One of the possible DMA channels listed by DMA_CHANNEL
9813  Returns:
9814  None.
9815  Example:
9816  <code>
9817  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9818  DMA_CHANNEL_4 );
9819  </code>
9820  Remarks:
9821  This feature is not available on all devices. Please refer to the specific
9822  device data sheet to determine availability.
9823 */
9824 
9825 void
9827  DMA_MODULE_ID index ,
9828  DMA_CHANNEL channel ) ;
9829 // *****************************************************************************
9830 // *****************************************************************************
9831 // Section: DMA start/end functions
9832 // *****************************************************************************
9833 // *****************************************************************************
9834 //******************************************************************************
9835 /* Function:
9836  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9837  DMA_CHANNEL channel )
9838  Summary:
9839  Initiates transfer on the specified channel.
9840  Description:
9841  This function initiates transfer on the specified channel. This is a forced transfer
9842  controlled via software.
9843  Precondition:
9844  None.
9845  Parameters:
9846  channel - One of the possible DMA channels listed by DMA_CHANNEL
9847  Returns:
9848  None.
9849  Example:
9850  <code>
9851  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9852  DMA_CHANNEL_4 );
9853  </code>
9854  Remarks:
9855  This function implements an operation of the StartTransfer feature.
9856  This feature may not be available on all devices. Please refer to the
9857  specific device data sheet to determine availability or use the
9858  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9859  determine whether this feature is available.
9860 */
9861 
9862 void
9864  DMA_MODULE_ID index ,
9865  DMA_CHANNEL channel ) ;
9866 //******************************************************************************
9867 /* Function:
9868  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9869  DMA_CHANNEL channel )
9870  Summary:
9871  Aborts transfer on the specified channel.
9872  Description:
9873  This function aborts transfer on the specified channel. This is a forced abort
9874  controlled via software.
9875  Precondition:
9876  None.
9877  Parameters:
9878  channel - One of the possible DMA channels listed by DMA_CHANNEL
9879  Returns:
9880  None.
9881  Example:
9882  <code>
9883  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9884  DMA_CHANNEL_4 );
9885  </code>
9886  Remarks:
9887  This function implements an operation of the AbortTransfer feature.
9888  This feature may not be available on all devices. Please refer to the
9889  specific device data sheet to determine availability or use the
9890  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9891  determine whether this feature is available.
9892 */
9893 
9894 void
9896  DMA_MODULE_ID index ,
9897  DMA_CHANNEL channel ) ;
9898 // *****************************************************************************
9899 // *****************************************************************************
9900 // Section: DMA General Configuration functions
9901 // *****************************************************************************
9902 // *****************************************************************************
9903 //******************************************************************************
9904 /* Function:
9905  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9906  Summary:
9907  Sets the BUSY bit of the DMA controller.
9908  Description:
9909  This function sets the BUSY bit of the DMA controller. The DMA module is active.
9910  Precondition:
9911  None.
9912  Parameters:
9913  None.
9914  Returns:
9915  None.
9916  Example:
9917  <code>
9918  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
9919  </code>
9920  Remarks:
9921  This function implements an operation of the Busy feature.
9922  This feature may not be available on all devices. Please refer to the
9923  specific device data sheet to determine availability or use the
9924  PLIB_DMA_ExistsBusy function in your application to automatically
9925  determine whether this feature is available.
9926 */
9927 
9928 void
9930  DMA_MODULE_ID index ) ;
9931 //******************************************************************************
9932 /* Function:
9933  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
9934  Summary:
9935  Resets the BUSY bit of the DMA controller.
9936  Description:
9937  This function resets the BUSY bit of the DMA controller. The DMA module is
9938  disabled and is not actively transferring data.
9939  Precondition:
9940  None.
9941  Parameters:
9942  None.
9943  Returns:
9944  None.
9945  Example:
9946  <code>
9947  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
9948  </code>
9949  Remarks:
9950  This function implements an operation of the Busy feature.
9951  This feature may not be available on all devices. Please refer to the
9952  specific device data sheet to determine availability or use the
9953  PLIB_DMA_ExistsBusy function in your application to automatically
9954  determine whether this feature is available.
9955 */
9956 
9957 void
9959  DMA_MODULE_ID index ) ;
9960 //******************************************************************************
9961 /* Function:
9962  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
9963  Summary:
9964  Gets the BUSY bit of the DMA controller.
9965  Description:
9966  This function gets the BUSY bit of the DMA controller.
9967  Precondition:
9968  None.
9969  Parameters:
9970  None.
9971  Returns:
9972  - true - DMA module is active
9973  - false - DMA module is disabled and is not actively transferring data
9974  Example:
9975  <code>
9976  bool dmaBusyStatus;
9977  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
9978  </code>
9979  Remarks:
9980  This function implements an operation of the Busy feature.
9981  This feature may not be available on all devices. Please refer to the
9982  specific device data sheet to determine availability or use the
9983  PLIB_DMA_ExistsBusy function in your application to automatically
9984  determine whether this feature is available.
9985 */
9986 
9987 bool
9988  PLIB_DMA_IsBusy (
9989  DMA_MODULE_ID index ) ;
9990 //******************************************************************************
9991 /* Function:
9992  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
9993  Summary:
9994  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
9995  Description:
9996  This function suspends the DMA transfers to allow uninterrupted access
9997  by the CPU to the data bus.
9998  Precondition:
9999  None.
10000  Parameters:
10001  None.
10002  Returns:
10003  None.
10004  Example:
10005  <code>
10006  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10007  </code>
10008  Remarks:
10009  This function implements an operation of the Suspend feature.
10010  This feature may not be available on all devices. Please refer to the
10011  specific device data sheet to determine availability or use the
10012  PLIB_DMA_ExistsSuspend function in your application to automatically
10013  determine whether this feature is available.
10014 */
10015 
10016 void
10018  DMA_MODULE_ID index ) ;
10019 //******************************************************************************
10020 /* Function:
10021  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10022  Summary:
10023  DMA suspend is disabled and the DMA module operates normally.
10024  Description:
10025  This function disables the DMA suspend. The DMA module continues to operate
10026  normally.
10027  Precondition:
10028  None.
10029  Parameters:
10030  None.
10031  Returns:
10032  None.
10033  Example:
10034  <code>
10035  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10036  </code>
10037  Remarks:
10038  This function implements an operation of the Suspend feature.
10039  This feature may not be available on all devices. Please refer to the
10040  specific device data sheet to determine availability or use the
10041  PLIB_DMA_ExistsSuspend function in your application to automatically
10042  determine whether this feature is available.
10043 */
10044 
10045 void
10047  DMA_MODULE_ID index ) ;
10048 //******************************************************************************
10049 /* Function:
10050  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10051  Summary:
10052  Returns the DMA suspend status.
10053  Description:
10054  This function returns the DMA suspend status.
10055  Precondition:
10056  None.
10057  Parameters:
10058  None.
10059  Returns:
10060  - true - The DMA transfers are suspended
10061  - false - The DMA operates normally
10062  Example:
10063  <code>
10064  bool dmaSuspendStatus;
10065  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10066  </code>
10067  Remarks:
10068  This function implements an operation of the Suspend feature.
10069  This feature may not be available on all devices. Please refer to the
10070  specific device data sheet to determine availability or use the
10071  PLIB_DMA_ExistsSuspend function in your application to automatically
10072  determine whether this feature is available.
10073 */
10074 
10075 bool
10077  DMA_MODULE_ID index ) ;
10078 //******************************************************************************
10079 /* Function:
10080  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10081  Summary:
10082  DMA transfers are halted during Idle mode.
10083  Description:
10084  This function halts DMA transfers during Idle mode.
10085  Precondition:
10086  None.
10087  Parameters:
10088  None.
10089  Returns:
10090  None.
10091  Example:
10092  <code>
10093  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10094  </code>
10095  Remarks:
10096  This function implements an operation of the StopInIdle feature.
10097  This feature may not be available on all devices. Please refer to the
10098  specific device data sheet to determine availability or use the
10099  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10100  determine whether this feature is available.
10101 */
10102 
10103 void
10105  DMA_MODULE_ID index ) ;
10106 //******************************************************************************
10107 /* Function:
10108  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10109  Summary:
10110  DMA transfers continue during Idle mode.
10111  Description:
10112  This function causes DMA transfers to continue during Idle mode.
10113  Precondition:
10114  None.
10115  Parameters:
10116  None.
10117  Returns:
10118  None.
10119  Example:
10120  <code>
10121  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10122  </code>
10123  Remarks:
10124  This function implements an operation of the StopInIdle feature.
10125  This feature may not be available on all devices. Please refer to the
10126  specific device data sheet to determine availability or use the
10127  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10128  determine whether this feature is available.
10129 */
10130 
10131 void
10133  DMA_MODULE_ID index ) ;
10134 //******************************************************************************
10135 /* Function:
10136  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10137  Summary:
10138  DMA module is enabled.
10139  Description:
10140  This function enables the DMA module.
10141  Precondition:
10142  None.
10143  Parameters:
10144  None.
10145  Returns:
10146  None.
10147  Example:
10148  <code>
10149  PLIB_DMA_Enable( DMA_ID_0 );
10150  </code>
10151  Remarks:
10152  This function implements an operation of the EnableControl feature.
10153  This feature may not be available on all devices. Please refer to the
10154  specific device data sheet to determine availability or use the
10155  PLIB_DMA_ExistsEnableControl function in your application to automatically
10156  determine whether this feature is available.
10157 */
10158 
10159 void
10160  PLIB_DMA_Enable (
10161  DMA_MODULE_ID index ) ;
10162 //******************************************************************************
10163 /* Function:
10164  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10165  Summary:
10166  Returns the DMA module enable status.
10167  Description:
10168  This function returns the DMA module enable status.
10169  Precondition:
10170  None.
10171  Parameters:
10172  None.
10173  Returns:
10174  - true - The DMA is enabled
10175  - false - The DMA is disabled
10176  Example:
10177  <code>
10178  PLIB_DMA_IsEnabled( DMA_ID_0 );
10179  </code>
10180  Remarks:
10181  This function implements an operation of the EnableControl feature.
10182  This feature may not be available on all devices. Please refer to the
10183  specific device data sheet to determine availability or use the
10184  PLIB_DMA_ExistsEnableControl function in your application to automatically
10185  determine whether this feature is available.
10186 */
10187 
10188 bool
10190  DMA_MODULE_ID index ) ;
10191 //******************************************************************************
10192 /* Function:
10193  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10194  Summary:
10195  DMA module is disabled.
10196  Description:
10197  This function disables the DMA module.
10198  Precondition:
10199  None.
10200  Parameters:
10201  None.
10202  Returns:
10203  None.
10204  Example:
10205  <code>
10206  PLIB_DMA_Disable( DMA_ID_0 );
10207  </code>
10208  Remarks:
10209  This function implements an operation of the EnableControl feature.
10210  This feature may not be available on all devices. Please refer to the
10211  specific device data sheet to determine availability or use the
10212  PLIB_DMA_ExistsEnableControl function in your application to automatically
10213  determine whether this feature is available.
10214 */
10215 
10216 void
10218  DMA_MODULE_ID index ) ;
10219 // *****************************************************************************
10220 // *****************************************************************************
10221 // Section: DMA status functions
10222 // *****************************************************************************
10223 // *****************************************************************************
10224 //******************************************************************************
10225 /* Function:
10226  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10227  Summary:
10228  Returns the DMA channel bits.
10229  Description:
10230  This function returns the channel bits.
10231  Precondition:
10232  None.
10233  Parameters:
10234  None.
10235  Returns:
10236  - uint8_t - DMA channel bits
10237  Example:
10238  <code>
10239  uint8_t dmaChBits;
10240  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10241  </code>
10242  Remarks:
10243  This function implements an operation of the ChannelBits feature.
10244  This feature may not be available on all devices. Please refer to the
10245  specific device data sheet to determine availability or use the
10246  PLIB_DMA_ExistsChannelBits function in your application to automatically
10247  determine whether this feature is available.
10248 */
10249 
10250 uint8_t
10252  DMA_MODULE_ID index ) ;
10253 //******************************************************************************
10254 /* Function:
10255  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10256  Summary:
10257  Returns true if the last DMA bus access was a read.
10258  Description:
10259  This function returns true if the last DMA bus access was a read.
10260  Precondition:
10261  None.
10262  Parameters:
10263  None.
10264  Returns:
10265  - true - The last bus access was a read
10266  - false - The last bus access was not a read
10267  Example:
10268  <code>
10269  bool dmaLastBusAccessType;
10270  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10271  </code>
10272  Remarks:
10273  This function implements an operation of the LastBusAccess feature.
10274  This feature may not be available on all devices. Please refer to the
10275  specific device data sheet to determine availability or use the
10276  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10277  determine whether this feature is available.
10278 */
10279 
10280 bool
10282  DMA_MODULE_ID index ) ;
10283 //******************************************************************************
10284 /* Function:
10285  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10286  Summary:
10287  Returns true if the last DMA bus access was a write.
10288  Description:
10289  This function returns true if the last DMA bus access was a write operation.
10290  Precondition:
10291  None.
10292  Parameters:
10293  None.
10294  Returns:
10295  - true - The last bus access was a write operation
10296  - false - The last bus access was not a write operation
10297  Example:
10298  <code>
10299  bool dmaLastBusAccessType;
10300  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10301  </code>
10302  Remarks:
10303  This function implements an operation of the LastBusAccess feature.
10304  This feature may not be available on all devices. Please refer to the
10305  specific device data sheet to determine availability or use the
10306  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10307  determine whether this feature is available.
10308 */
10309 
10310 bool
10312  DMA_MODULE_ID index ) ;
10313 //******************************************************************************
10314 /* Function:
10315  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10316  Summary:
10317  Returns the address of the most recent DMA access.
10318  Description:
10319  This function returns the address of the most recent DMA access.
10320  Precondition:
10321  None.
10322  Parameters:
10323  None.
10324  Returns:
10325  - uint32_t - The most recent address accessed by the DMA
10326  Example:
10327  <code>
10328  uint32_t dmaLastAddressAccessed;
10329  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10330  </code>
10331  Remarks:
10332  This function implements an operation of the RecentAddress feature.
10333  This feature may not be available on all devices. Please refer to the
10334  specific device data sheet to determine availability or use the
10335  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10336  determine whether this feature is available.
10337 */
10338 
10339 uint32_t
10341  DMA_MODULE_ID index ) ;
10342 // *****************************************************************************
10343 // *****************************************************************************
10344 // Section: DMA Module CRC Feature Interface Functions
10345 // *****************************************************************************
10346 // *****************************************************************************
10347 //******************************************************************************
10348 /* Function:
10349  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10350  DMA_CHANNEL channel )
10351  Summary:
10352  Assigns the CRC to the specified DMA channel.
10353  Description:
10354  This function assigns the CRC feature to the specified channel.
10355  Precondition:
10356  None.
10357  Parameters:
10358  channel - One of the possible DMA channels listed by DMA_CHANNEL
10359  Returns:
10360  None.
10361  Example:
10362  <code>
10363  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10364  DMA_CHANNEL_5 );
10365  </code>
10366  Remarks:
10367  This function implements an operation of the CRCChannel feature.
10368  This feature may not be available on all devices. Please refer to the
10369  specific device data sheet to determine availability or use the
10370  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10371  determine whether this feature is available.
10372 */
10373 
10374 void
10376  DMA_MODULE_ID index ,
10377  DMA_CHANNEL channel ) ;
10378 //******************************************************************************
10379 /* Function:
10380  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10381  Summary:
10382  Returns the current DMA channel to which the CRC is assigned.
10383  Description:
10384  This function returns the current DMA channel to which the CRC is assigned.
10385  Precondition:
10386  None.
10387  Parameters:
10388  None.
10389  Returns:
10390  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10391  Example:
10392  <code>
10393  DMA_CHANNEL crcChannel;
10394  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10395  </code>
10396  Remarks:
10397  This function implements an operation of the CRCChannel feature.
10398  This feature may not be available on all devices. Please refer to the
10399  specific device data sheet to determine availability or use the
10400  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10401  determine whether this feature is available.
10402 */
10403 
10404 DMA_CHANNEL
10406  DMA_MODULE_ID index ) ;
10407 //******************************************************************************
10408 /* Function:
10409  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10410  DMA_CRC_TYPE CRCType )
10411  Summary:
10412  Selects the DMA module CRC feature type.
10413  Description:
10414  This function selects the DMA module CRC feature type. The CRC feature will
10415  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10416  checksum.
10417  Precondition:
10418  None.
10419  Parameters:
10420  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10421  Returns:
10422  None.
10423  Example:
10424  <code>
10425  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10426  DMA_CRC_IP_HEADER );
10427  </code>
10428  Remarks:
10429  This function implements an operation of the CRCType feature.
10430  This feature may not be available on all devices. Please refer to the
10431  specific device data sheet to determine availability or use the
10432  PLIB_DMA_ExistsCRCType function in your application to automatically
10433  determine whether this feature is available.
10434 */
10435 
10436 void
10438  DMA_MODULE_ID index ,
10439  DMA_CRC_TYPE CRCType ) ;
10440 //******************************************************************************
10441 /* Function:
10442  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10443  Summary:
10444  Gets the current DMA module CRC feature type.
10445  Description:
10446  This function gets the DMA module CRC feature type. The CRC feature will
10447  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10448  checksum.
10449  Precondition:
10450  None.
10451  Parameters:
10452  None.
10453  Returns:
10454  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10455  Example:
10456  <code>
10457  DMA_CRC_TYPE CRCType;
10458  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10459  </code>
10460  Remarks:
10461  This function implements an operation of the CRCType feature.
10462  This feature may not be available on all devices. Please refer to the
10463  specific device data sheet to determine availability or use the
10464  PLIB_DMA_ExistsCRCType function in your application to automatically
10465  determine whether this feature is available.
10466 */
10467 
10468 DMA_CRC_TYPE
10470  DMA_MODULE_ID index ) ;
10471 //******************************************************************************
10472 /* Function:
10473  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10474  Summary:
10475  Enables the CRC append mode.
10476  Description:
10477  This function enables the CRC append mode. The DMA transfers data from the source
10478  into the CRC, but not to the destination. When a block transfer completes, the
10479  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10480  Precondition:
10481  None.
10482  Parameters:
10483  None.
10484  Returns:
10485  None.
10486  Example:
10487  <code>
10488  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10489  </code>
10490  Remarks:
10491  This function implements an operation of the CRCAppendMode feature.
10492  This feature may not be available on all devices. Please refer to the
10493  specific device data sheet to determine availability or use the
10494  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10495  determine whether this feature is available.
10496 */
10497 
10498 void
10500  DMA_MODULE_ID index ) ;
10501 //******************************************************************************
10502 /* Function:
10503  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10504  Summary:
10505  Gets the enable status of the CRC append mode.
10506  Description:
10507  This function gets the enable status of the CRC append mode.
10508  Precondition:
10509  None.
10510  Parameters:
10511  None.
10512  Returns:
10513  - true - CRC append mode is enabled
10514  - false - CRC append mode is disabled
10515  Example:
10516  <code>
10517  bool DMAcrcAppendMode;
10518  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10519  </code>
10520  Remarks:
10521  This function implements an operation of the CRCAppendMode feature.
10522  This feature may not be available on all devices. Please refer to the
10523  specific device data sheet to determine availability or use the
10524  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10525  determine whether this feature is available.
10526 */
10527 
10528 bool
10530  DMA_MODULE_ID index ) ;
10531 //******************************************************************************
10532 /* Function:
10533  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10534  Summary:
10535  Disables the CRC append mode.
10536  Description:
10537  This function disables the CRC append mode. The DMA transfers data from the
10538  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10539  as it writes the data to the destination.
10540  Precondition:
10541  None.
10542  Parameters:
10543  None.
10544  Returns:
10545  None.
10546  Example:
10547  <code>
10548  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10549  </code>
10550  Remarks:
10551  This function implements an operation of the CRCAppendMode feature.
10552  This feature may not be available on all devices. Please refer to the
10553  specific device data sheet to determine availability or use the
10554  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10555  determine whether this feature is available.
10556 */
10557 
10558 void
10560  DMA_MODULE_ID index ) ;
10561 //******************************************************************************
10562 /* Function:
10563  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10564  Summary:
10565  Enables the DMA module CRC feature.
10566  Description:
10567  This function enables the DMA module CRC feature. The channel transfers are
10568  routed through the CRC.
10569  Precondition:
10570  None.
10571  Parameters:
10572  None.
10573  Returns:
10574  None.
10575  Example:
10576  <code>
10577  PLIB_DMA_CRCEnable( DMA_ID_0 );
10578  </code>
10579  Remarks:
10580  This function implements an operation of the CRC feature.
10581  This feature may not be available on all devices. Please refer to the
10582  specific device data sheet to determine availability or use the
10583  PLIB_DMA_ExistsCRC function in your application to automatically
10584  determine whether this feature is available.
10585 */
10586 
10587 void
10589  DMA_MODULE_ID index ) ;
10590 //******************************************************************************
10591 /* Function:
10592  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10593  Summary:
10594  Gets the enable status of the CRC feature.
10595  Description:
10596  This function gets the enable status of the CRC feature.
10597  Precondition:
10598  None.
10599  Parameters:
10600  None.
10601  Returns:
10602  - true - The CRC feature is enabled
10603  - false - The CRC feature is disabled
10604  Example:
10605  <code>
10606  bool DMAcrcStatus;
10607  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10608  </code>
10609  Remarks:
10610  This function implements an operation of the CRC feature.
10611  This feature may not be available on all devices. Please refer to the
10612  specific device data sheet to determine availability or use the
10613  PLIB_DMA_ExistsCRC function in your application to automatically
10614  determine whether this feature is available.
10615 */
10616 
10617 bool
10619  DMA_MODULE_ID index ) ;
10620 //******************************************************************************
10621 /* Function:
10622  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10623  Summary:
10624  Disables the DMA module CRC feature.
10625  Description:
10626  This function disables the DMA module CRC feature. The channel transfers proceed
10627  normally.
10628  Precondition:
10629  None.
10630  Parameters:
10631  None.
10632  Returns:
10633  None.
10634  Example:
10635  <code>
10636  PLIB_DMA_CRCDisable( DMA_ID_0 );
10637  </code>
10638  Remarks:
10639  This function implements an operation of the CRC feature.
10640  This feature may not be available on all devices. Please refer to the
10641  specific device data sheet to determine availability or use the
10642  PLIB_DMA_ExistsCRC function in your application to automatically
10643  determine whether this feature is available.
10644 */
10645 
10646 void
10648  DMA_MODULE_ID index ) ;
10649 //******************************************************************************
10650 /* Function:
10651  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10652  uint8_t polyLength )
10653  Summary:
10654  Selects the polynomial length.
10655  Description:
10656  This function Selects the polynomial length.
10657  Precondition:
10658  None.
10659  Parameters:
10660  polyLength - Polynomial length
10661  Returns:
10662  None.
10663  Example:
10664  <code>
10665  uint8_t polyLength = 0x2;
10666  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10667  </code>
10668  Remarks:
10669  This function implements an operation of the CRCPolynomialLength feature.
10670  This feature may not be available on all devices. Please refer to the
10671  specific device data sheet to determine availability or use the
10672  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10673  determine whether this feature is available.
10674 */
10675 
10676 void
10678  DMA_MODULE_ID index ,
10679  uint8_t polyLength ) ;
10680 //******************************************************************************
10681 /* Function:
10682  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10683  Summary:
10684  Gets the current polynomial length.
10685  Description:
10686  This function gets the current polynomial length.
10687  Precondition:
10688  None.
10689  Parameters:
10690  None.
10691  Returns:
10692  - uint8_t - Polynomial length
10693  Example:
10694  <code>
10695  uint8_t polyLength;
10696  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10697  </code>
10698  Remarks:
10699  This function implements an operation of the CRCPolynomialLength feature.
10700  This feature may not be available on all devices. Please refer to the
10701  specific device data sheet to determine availability or use the
10702  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10703  determine whether this feature is available.
10704 */
10705 
10706 uint8_t
10708  DMA_MODULE_ID index ) ;
10709 //******************************************************************************
10710 /* Function:
10711  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10712  DMA_CRC_BIT_ORDER bitOrder )
10713  Summary:
10714  Selects the bit order for checksum calculation.
10715  Description:
10716  This function selects the bit order for checksum calculation.
10717  Precondition:
10718  None.
10719  Parameters:
10720  bitOrder - Specifies the bit order for CRC calculation
10721  Returns:
10722  None.
10723  Example:
10724  <code>
10725  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10726  </code>
10727  Remarks:
10728  This function implements an operation of the CRCBitOrder feature.
10729  This feature may not be available on all devices. Please refer to the
10730  specific device data sheet to determine availability or use the
10731  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10732  determine whether this feature is available.
10733 */
10734 
10735 void
10737  DMA_MODULE_ID index ,
10738  DMA_CRC_BIT_ORDER bitOrder ) ;
10739 //******************************************************************************
10740 /* Function:
10741  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10742  Summary:
10743  The source data is written to the destination reordered as defined by the
10744  BYTO<1:0> bits.
10745  Description:
10746  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10747  The source data is written to the destination reordered as defined by the
10748  BYTO<1:0> bits.
10749  Precondition:
10750  None.
10751  Parameters:
10752  None.
10753  Returns:
10754  None.
10755  Example:
10756  <code>
10757  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10758  </code>
10759  Remarks:
10760  This function implements an operation of the CRCWriteByteOrder feature.
10761  This feature may not be available on all devices. Please refer to the
10762  specific device data sheet to determine availability or use the
10763  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10764  determine whether this feature is available.
10765 */
10766 
10767 void
10769  DMA_MODULE_ID index ) ;
10770 //******************************************************************************
10771 /* Function:
10772  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10773  Summary:
10774  The source data is written to the destination unaltered.
10775  Description:
10776  This function disables byte order alteration. The source data is written
10777  to the destination unaltered.
10778  Precondition:
10779  None.
10780  Parameters:
10781  None.
10782  Returns:
10783  None.
10784  Example:
10785  <code>
10786  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10787  </code>
10788  Remarks:
10789  This function implements an operation of the CRCWriteByteOrder feature.
10790  This feature may not be available on all devices. Please refer to the
10791  specific device data sheet to determine availability or use the
10792  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10793  determine whether this feature is available.
10794 */
10795 
10796 void
10798  DMA_MODULE_ID index ) ;
10799 //******************************************************************************
10800 /* Function:
10801  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10802  DMA_CRC_BYTE_ORDER byteOrder )
10803  Summary:
10804  Selects the byte order.
10805  Description:
10806  This function selects the byte order.
10807  Precondition:
10808  The WBO bit must be set to use this function.
10809  Parameters:
10810  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10811  Returns:
10812  None.
10813  Example:
10814  <code>
10815  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10816  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10817  </code>
10818  Remarks:
10819  This function implements an operation of the CRCByteOrder feature.
10820  This feature may not be available on all devices. Please refer to the
10821  specific device data sheet to determine availability or use the
10822  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10823  determine whether this feature is available.
10824 */
10825 
10826 void
10828  DMA_MODULE_ID index ,
10829  DMA_CRC_BYTE_ORDER byteOrder ) ;
10830 //******************************************************************************
10831 /* Function:
10832  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10833  Summary:
10834  Gets the current byte order selected by the DMA module CRC feature.
10835  Description:
10836  This function gets the current byte order selected by the DMA module CRC feature.
10837  Precondition:
10838  The WBO bit must be set to use this function.
10839  Parameters:
10840  None.
10841  Returns:
10842  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10843  Example:
10844  <code>
10845  DMA_CRC_BYTE_ORDER byteOrder;
10846  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10847  </code>
10848  Remarks:
10849  This function implements an operation of the CRCByteOrder feature.
10850  This feature may not be available on all devices. Please refer to the
10851  specific device data sheet to determine availability or use the
10852  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10853  determine whether this feature is available.
10854 */
10855 
10856 DMA_CRC_BYTE_ORDER
10858  DMA_MODULE_ID index ) ;
10859 //******************************************************************************
10860 /* Function:
10861  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10862  Summary:
10863  Reads the contents of the DMA CRC data register.
10864  Description:
10865  This function reads the contents of the DMA CRC data register.
10866  Precondition:
10867  None.
10868  Parameters:
10869  None.
10870  Returns:
10871  - uint32_t - 32-bit CRC data
10872  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10873  device data sheet to determine availability.
10874  Example:
10875  <code>
10876  uint32_t DMACRCdata;
10877  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10878  </code>
10879  Remarks:
10880  This function implements an operation of the CRCData feature.
10881  This feature may not be available on all devices. Please refer to the
10882  specific device data sheet to determine availability or use the
10883  PLIB_DMA_ExistsCRCData function in your application to automatically
10884  determine whether this feature is available.
10885 */
10886 
10887 uint32_t
10889  DMA_MODULE_ID index ) ;
10890 //******************************************************************************
10891 /* Function:
10892  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10893  uint32_t DMACRCdata )
10894  Summary:
10895  Writes the contents of the DMA CRC data register with the specified data.
10896  Description:
10897  This function writes the contents of the DMA CRC data register.
10898  Precondition:
10899  None.
10900  Parameters:
10901  - DMACRCdata - 32-bit CRC data
10902  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10903  device data sheet to determine availability.
10904  Returns:
10905  None.
10906  Example:
10907  <code>
10908  uint32_t DMACRCdata = 0x0E0E0E;
10909  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
10910  </code>
10911  Remarks:
10912  This function implements an operation of the CRCData feature.
10913  This feature may not be available on all devices. Please refer to the
10914  specific device data sheet to determine availability or use the
10915  PLIB_DMA_ExistsCRCData function in your application to automatically
10916  determine whether this feature is available.
10917 */
10918 
10919 void
10921  DMA_MODULE_ID index ,
10922  uint32_t DMACRCdata ) ;
10923 //******************************************************************************
10924 /* Function:
10925  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
10926  Summary:
10927  Reads the CRC XOR register.
10928  Description:
10929  This function reads the CRC XOR register.
10930  Precondition:
10931  None.
10932  Parameters:
10933  None.
10934  Returns:
10935  - uint32_t - 32-bit CRC XOR enable mask data
10936  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10937  device data sheet to determine availability.
10938  Example:
10939  <code>
10940  uint32_t DMACRCXORdata;
10941  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
10942  </code>
10943  Remarks:
10944  This function implements an operation of the CRCXOREnable feature.
10945  This feature may not be available on all devices. Please refer to the
10946  specific device data sheet to determine availability or use the
10947  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10948  determine whether this feature is available.
10949 */
10950 
10951 uint32_t
10953  DMA_MODULE_ID index ) ;
10954 //******************************************************************************
10955 /* Function:
10956  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
10957  uint32_t DMACRCXOREnableMask )
10958  Summary:
10959  Writes to the CRC XOR enable register as per the specified enable mask.
10960  Description:
10961  This function writes to the CRC XOR enable register as per the specified
10962  enable mask. Each enabled bit will be taken as input to the shift register.
10963  Precondition:
10964  None.
10965  Parameters:
10966  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
10967  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10968  device data sheet to determine availability.
10969  Returns:
10970  None.
10971  Example:
10972  <code>
10973  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
10974  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
10975  </code>
10976  Remarks:
10977  This function implements an operation of the CRCXOREnable feature.
10978  This feature may not be available on all devices. Please refer to the
10979  specific device data sheet to determine availability or use the
10980  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10981  determine whether this feature is available.
10982 */
10983 
10984 void
10986  DMA_MODULE_ID index ,
10987  uint32_t DMACRCXOREnableMask ) ;
10988 // *****************************************************************************
10989 // *****************************************************************************
10990 // Section: DMA Address control Interface functions
10991 // *****************************************************************************
10992 // *****************************************************************************
10993 //******************************************************************************
10994 /* Function:
10995  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
10996  DMA_CHANNEL dmaChannel )
10997  Summary:
10998  Reads the source start address configured for the specified channel.
10999  Description:
11000  This function reads the source start address configured for the specified
11001  channel.
11002  Precondition:
11003  None.
11004  Parameters:
11005  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11006  Returns:
11007  - uint32_t - The source start address configured for this channel
11008  Example:
11009  <code>
11010  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11011  uint32_t SourceStartAddress;
11012  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11013  spiDMAChannel );
11014  </code>
11015  Remarks:
11016  This function implements an operation of the ChannelXSourceStartAddress feature.
11017  This feature may not be available on all devices. Please refer to the
11018  specific device data sheet to determine availability or use the
11019  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11020  determine whether this feature is available.
11021 */
11022 
11023 uint32_t
11025  DMA_MODULE_ID index ,
11026  DMA_CHANNEL dmaChannel ) ;
11027 //******************************************************************************
11028 /* Function:
11029  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11030  DMA_CHANNEL dmaChannel,
11031  uint32_t sourceStartAddress)
11032  Summary:
11033  Writes the specified source start address into the register
11034  corresponding to the specified channel.
11035  Description:
11036  This function writes the specified Source start address into the register
11037  corresponding to the specified channel.
11038  Precondition:
11039  None.
11040  Parameters:
11041  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11042  sourceStartAddress - The source start address
11043  Returns:
11044  None.
11045  Example:
11046  <code>
11047  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11048  uint32_t sourceStartAddress = 0x00FDEA00;
11049  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11050  spiDMAChannel,
11051  sourceStartAddress );
11052  </code>
11053  Remarks:
11054  This function implements an operation of the ChannelXSourceStartAddress feature.
11055  This feature may not be available on all devices. Please refer to the
11056  specific device data sheet to determine availability or use the
11057  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11058  determine whether this feature is available.
11059 */
11060 
11061 void
11063  DMA_MODULE_ID index ,
11064  DMA_CHANNEL dmaChannel ,
11065  uint32_t sourceStartAddress ) ;
11066 //******************************************************************************
11067 /* Function:
11068  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11069  DMA_CHANNEL dmaChannel )
11070  Summary:
11071  Reads the destination start address configured for the specified channel.
11072  Description:
11073  This function reads the destination start address configured for the specified
11074  channel.
11075  Precondition:
11076  None.
11077  Parameters:
11078  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11079  Returns:
11080  - uint32_t - The destination start address configured for this channel
11081  Example:
11082  <code>
11083  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11084  uint32_t DestinationStartAddress;
11085  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11086  DMA_ID_0,
11087  spiDMAChannel );
11088  </code>
11089  Remarks:
11090  This function implements an operation of the ChannelXDestinationStartAddress feature.
11091  This feature may not be available on all devices. Please refer to the
11092  specific device data sheet to determine availability or use the
11093  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11094  determine whether this feature is available.
11095 */
11096 
11097 uint32_t
11099  DMA_MODULE_ID index ,
11100  DMA_CHANNEL dmaChannel ) ;
11101 //******************************************************************************
11102 /* Function:
11103  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11104  DMA_MODULE_ID index,
11105  DMA_CHANNEL dmaChannel,
11106  uint32_t destinationStartAddress)
11107  Summary:
11108  Writes the specified destination start address into the register corresponding to
11109  the specified channel.
11110  Description:
11111  This function writes the specified destination start address into the register
11112  corresponding to the specified channel.
11113  Precondition:
11114  None.
11115  Parameters:
11116  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11117  destinationStartAddress - The destination start address
11118  Returns:
11119  None.
11120  Example:
11121  <code>
11122  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11123  uint32_t destinationStartAddress = 0x00FDEA00;
11124  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11125  spiDMAChannel,
11126  destinationStartAddress );
11127  </code>
11128  Remarks:
11129  This function implements an operation of the ChannelXDestinationStartAddress feature.
11130  This feature may not be available on all devices. Please refer to the
11131  specific device data sheet to determine availability or use the
11132  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11133  determine whether this feature is available.
11134 */
11135 
11136 void
11138  DMA_MODULE_ID index ,
11139  DMA_CHANNEL dmaChannel ,
11140  uint32_t destinationStartAddress ) ;
11141 // *****************************************************************************
11142 // *****************************************************************************
11143 // Section: DMA Data control Interface functions
11144 // *****************************************************************************
11145 // *****************************************************************************
11146 //******************************************************************************
11147 /* Function:
11148  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11149  DMA_CHANNEL dmaChannel )
11150  Summary:
11151  Reads the source size configured for the specified channel.
11152  Description:
11153  This function reads the source size configured for the specified
11154  channel.
11155  Precondition:
11156  None.
11157  Parameters:
11158  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11159  Returns:
11160  - uint16_t - The Source size configured (in bytes) for this channel.
11161  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11162  device data sheet to determine availability.
11163  Example:
11164  <code>
11165  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11166  uint16_t sourceSize;
11167  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11168  spiDMAChannel );
11169  </code>
11170  Remarks:
11171  This function implements an operation of the ChannelXSourceSize feature.
11172  This feature may not be available on all devices. Please refer to the
11173  specific device data sheet to determine availability or use the
11174  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11175  determine whether this feature is available.
11176 */
11177 
11178 uint16_t
11180  DMA_MODULE_ID index ,
11181  DMA_CHANNEL dmaChannel ) ;
11182 //******************************************************************************
11183 /* Function:
11184  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11185  DMA_CHANNEL dmaChannel,
11186  uint16_t sourceSize)
11187  Summary:
11188  Writes the specified source size into the register corresponding
11189  to the specified channel.
11190  Description:
11191  This function writes the specified source size into the register
11192  corresponding to the specified channel.
11193  Precondition:
11194  None.
11195  Parameters:
11196  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11197  sourceSize - The source size. The source size (8-bit, 16-bit) is
11198  device-specific. Please refer to the specific device data
11199  sheet to determine availability.
11200  Returns:
11201  None.
11202  Example:
11203  <code>
11204  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11205  uint16_t sourceSize = 0xA00;
11206  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11207  spiDMAChannel,
11208  sourceSize );
11209  </code>
11210  Remarks:
11211  This function implements an operation of the ChannelXSourceSize feature.
11212  This feature may not be available on all devices. Please refer to the
11213  specific device data sheet to determine availability or use the
11214  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11215  determine whether this feature is available.
11216 */
11217 
11218 void
11220  DMA_MODULE_ID index ,
11221  DMA_CHANNEL dmaChannel ,
11222  uint16_t sourceSize ) ;
11223 //******************************************************************************
11224 /* Function:
11225  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11226  DMA_CHANNEL dmaChannel )
11227  Summary:
11228  Reads the destination size configured for the specified channel.
11229  Description:
11230  This function reads the destination size configured for the specified
11231  channel.
11232  Precondition:
11233  None.
11234  Parameters:
11235  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11236  Returns:
11237  - uint16_t - The destination size configured (in bytes) for this channel.
11238  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11239  device data sheet to determine availability.
11240  Example:
11241  <code>
11242  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11243  uint16_t DestinationSize;
11244  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11245  spiDMAChannel );
11246  </code>
11247  Remarks:
11248  This function implements an operation of the ChannelXDestinationSize feature.
11249  This feature may not be available on all devices. Please refer to the
11250  specific device data sheet to determine availability or use the
11251  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11252  determine whether this feature is available.
11253 */
11254 
11255 uint16_t
11257  DMA_MODULE_ID index ,
11258  DMA_CHANNEL dmaChannel ) ;
11259 //******************************************************************************
11260 /* Function:
11261  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11262  DMA_CHANNEL dmaChannel,
11263  uint16_t destinationSize)
11264  Summary:
11265  Writes the specified destination size into the register corresponding
11266  to the specified channel.
11267  Description:
11268  This function writes the specified destination size into the register
11269  corresponding to the specified channel.
11270  Precondition:
11271  None.
11272  Parameters:
11273  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11274  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11275  is device-specific. Please refer to the specific device
11276  data sheet to determine availability.)
11277  Returns:
11278  None.
11279  Example:
11280  <code>
11281  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11282  uint16_t destinationSize = 0xA00;
11283  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11284  </code>
11285  Remarks:
11286  This function implements an operation of the ChannelXDestinationSize feature.
11287  This feature may not be available on all devices. Please refer to the
11288  specific device data sheet to determine availability or use the
11289  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11290  determine whether this feature is available.
11291 */
11292 
11293 void
11295  DMA_MODULE_ID index ,
11296  DMA_CHANNEL dmaChannel ,
11297  uint16_t destinationSize ) ;
11298 //******************************************************************************
11299 /* Function:
11300  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11301  DMA_CHANNEL dmaChannel )
11302  Summary:
11303  Reads the current byte of the source being pointed to for the specified channel.
11304  Description:
11305  This function reads the current byte of the source being pointed to for the
11306  specified channel.
11307  Precondition:
11308  None.
11309  Parameters:
11310  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11311  Returns:
11312  - uint16_t - The source byte being pointed to for this channel.
11313  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11314  device data sheet to determine availability.
11315  Example:
11316  <code>
11317  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11318  uint16_t sourcebyte;
11319  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11320  </code>
11321  Remarks:
11322  This function implements an operation of the ChannelXSourcePointer feature.
11323  This feature may not be available on all devices. Please refer to the
11324  specific device data sheet to determine availability or use the
11325  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11326  determine whether this feature is available.
11327 */
11328 
11329 uint16_t
11331  DMA_MODULE_ID index ,
11332  DMA_CHANNEL dmaChannel ) ;
11333 //******************************************************************************
11334 /* Function:
11335  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11336  DMA_CHANNEL dmaChannel )
11337  Summary:
11338  Reads the current byte of the destination being pointed to for the specified channel.
11339  Description:
11340  This function reads the current byte of the destination being pointed to for the
11341  specified channel.
11342  Precondition:
11343  None.
11344  Parameters:
11345  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11346  Returns:
11347  - uint16_t - The destination byte being pointed to for this channel.
11348  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11349  device data sheet to determine availability.
11350  Example:
11351  <code>
11352  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11353  uint16_t destinationbyte;
11354  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11355  spiDMAChannel );
11356  </code>
11357  Remarks:
11358  This function implements an operation of the ChannelXDestinationPointer feature.
11359  This feature may not be available on all devices. Please refer to the
11360  specific device data sheet to determine availability or use the
11361  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11362  determine whether this feature is available.
11363 */
11364 
11365 uint16_t
11367  DMA_MODULE_ID index ,
11368  DMA_CHANNEL dmaChannel ) ;
11369 //******************************************************************************
11370 /* Function:
11371  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11372  DMA_CHANNEL dmaChannel )
11373  Summary:
11374  Reads the cell size (in bytes) configured for the specified channel.
11375  Description:
11376  This function reads the cell size (in bytes) configured for the specified
11377  channel.
11378  Precondition:
11379  None.
11380  Parameters:
11381  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11382  Returns:
11383  - uint16_t - The cell size configured (in bytes) for this channel
11384  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11385  device data sheet to determine availability.
11386  Example:
11387  <code>
11388  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11389  uint16_t cellSize;
11390  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11391  spiDMAChannel );
11392  </code>
11393  Remarks:
11394  This function implements an operation of the ChannelXCellSize feature.
11395  This feature may not be available on all devices. Please refer to the
11396  specific device data sheet to determine availability or use the
11397  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11398  determine whether this feature is available.
11399 */
11400 
11401 uint16_t
11403  DMA_MODULE_ID index ,
11404  DMA_CHANNEL dmaChannel ) ;
11405 //******************************************************************************
11406 /* Function:
11407  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11408  DMA_CHANNEL dmaChannel,
11409  uint16_t cellSize)
11410  Summary:
11411  Writes the specified cell size into the register corresponding
11412  to the specified channel.
11413  Description:
11414  This function writes the specified cell size into the register
11415  corresponding to the specified channel.
11416  Precondition:
11417  None.
11418  Parameters:
11419  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11420  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11421  device-specific. Please refer to the specific device data
11422  sheet to determine availability.)
11423  Returns:
11424  None.
11425  Example:
11426  <code>
11427  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11428  uint16_t cellSize = 0x10;
11429  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11430  </code>
11431  Remarks:
11432  This function implements an operation of the ChannelXCellSize feature.
11433  This feature may not be available on all devices. Please refer to the
11434  specific device data sheet to determine availability or use the
11435  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11436  determine whether this feature is available.
11437 */
11438 
11439 void
11441  DMA_MODULE_ID index ,
11442  DMA_CHANNEL dmaChannel ,
11443  uint16_t CellSize ) ;
11444 //******************************************************************************
11445 /* Function:
11446  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11447  DMA_CHANNEL dmaChannel )
11448  Summary:
11449  Returns the number of bytes transferred since the last event.
11450  Description:
11451  This function returns the number of bytes transferred since the last event.
11452  Precondition:
11453  None.
11454  Parameters:
11455  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11456  Returns:
11457  - uint16_t - The number of bytes transferred since the last event.
11458  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11459  the specific device data sheet to determine availability.
11460  Example:
11461  <code>
11462  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11463  uint16_t CellProgress;
11464  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11465  spiDMAChannel );
11466  </code>
11467  Remarks:
11468  This function implements an operation of the ChannelXCellProgressPointer feature.
11469  This feature may not be available on all devices. Please refer to the
11470  specific device data sheet to determine availability or use the
11471  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11472  determine whether this feature is available.
11473 */
11474 
11475 uint16_t
11477  DMA_MODULE_ID index ,
11478  DMA_CHANNEL dmaChannel ) ;
11479 //******************************************************************************
11480 /* Function:
11481  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11482  DMA_CHANNEL dmaChannel )
11483  Summary:
11484  Returns the pattern matching (for DMA abort) data programmed for the specified
11485  channel.
11486  Description:
11487  This function returns pattern matching (for DMA abort) data programmed for
11488  the specified channel.
11489  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11490  the specific device data sheet to determine availability.)
11491  Precondition:
11492  None.
11493  Parameters:
11494  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11495  Returns:
11496  - uint16_t - The pattern matching data programmed for the current channel.
11497  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11498  the specific device data sheet to determine availability.
11499  Example:
11500  <code>
11501  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11502  uint16_t patternData;
11503  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11504  </code>
11505  Remarks:
11506  This function implements an operation of the ChannelXPatternData feature.
11507  This feature may not be available on all devices. Please refer to the
11508  specific device data sheet to determine availability or use the
11509  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11510  determine whether this feature is available.
11511 */
11512 
11513 uint16_t
11515  DMA_MODULE_ID index ,
11516  DMA_CHANNEL dmaChannel ) ;
11517 //******************************************************************************
11518 /* Function:
11519  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11520  DMA_CHANNEL dmaChannel,
11521  uint16_t patternData)
11522  Summary:
11523  Writes the specified pattern matching data (for DMA abort) into the register
11524  corresponding to the specified channel.
11525  Description:
11526  This function writes the specified pattern matching data (for DMA abort) into the
11527  register corresponding to the specified channel.
11528  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11529  the specific device data sheet to determine availability.)
11530  Precondition:
11531  None.
11532  Parameters:
11533  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11534  patternData - The pattern matching DATA programmed for the current channel
11535  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11536  the specific device data sheet to determine availability.)
11537  Returns:
11538  None.
11539  Example:
11540  <code>
11541  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11542  uint16_t patternData = '\0';
11543  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11544  </code>
11545  Remarks:
11546  This function implements an operation of the ChannelXPatternData feature.
11547  This feature may not be available on all devices. Please refer to the
11548  specific device data sheet to determine availability or use the
11549  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11550  determine whether this feature is available.
11551 */
11552 
11553 void
11555  DMA_MODULE_ID index ,
11556  DMA_CHANNEL dmaChannel ,
11557  uint16_t patternData ) ;
11558 // *****************************************************************************
11559 // *****************************************************************************
11560 // Section: DMA Interrupt Control Interface functions
11561 // *****************************************************************************
11562 // *****************************************************************************
11563 //******************************************************************************
11564 /* Function:
11565  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11566  DMA_CHANNEL dmaChannel,
11567  DMA_INT_TYPE dmaINTSource )
11568  Summary:
11569  Returns the status of the interrupt flag of the specified DMA interrupt source
11570  for the specified channel.
11571  Description:
11572  This function returns the status of the interrupt flag of the specified DMA interrupt
11573  source for the specified channel.
11574  Precondition:
11575  None.
11576  Parameters:
11577  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11578  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11579  Returns:
11580  - true - The interrupt flag is set
11581  - false - The interrupt flag is not set
11582  Example:
11583  <code>
11584  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11585  bool AddressErrorINTStatus;
11586  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11587  DMA_ID_0,
11588  spiDMAChannel,
11589  DMA_INT_ADDRESS_ERROR );
11590  </code>
11591  Remarks:
11592  This function implements an operation of the ChannelXINTSourceFlag feature.
11593  This feature may not be available on all devices. Please refer to the
11594  specific device data sheet to determine availability or use the
11595  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11596  determine whether this feature is available.
11597 */
11598 
11599 bool
11601  DMA_MODULE_ID index ,
11602  DMA_CHANNEL dmaChannel ,
11603  DMA_INT_TYPE dmaINTSource ) ;
11604 //******************************************************************************
11605 /* Function:
11606  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11607  DMA_CHANNEL dmaChannel,
11608  DMA_INT_TYPE dmaINTSource )
11609  Summary:
11610  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11611  Description:
11612  This function sets the interrupt flag of the specified DMA interrupt source for
11613  the specified channel.
11614  Precondition:
11615  None.
11616  Parameters:
11617  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11618  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11619  Returns:
11620  None.
11621  Example:
11622  <code>
11623  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11624  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11625  spiDMAChannel,
11626  DMA_INT_ADDRESS_ERROR );
11627  </code>
11628  Remarks:
11629  This function implements an operation of the ChannelXINTSourceFlag feature.
11630  This feature may not be available on all devices. Please refer to the
11631  specific device data sheet to determine availability or use the
11632  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11633  determine whether this feature is available.
11634 */
11635 
11636 void
11638  DMA_MODULE_ID index ,
11639  DMA_CHANNEL dmaChannel ,
11640  DMA_INT_TYPE dmaINTSource ) ;
11641 //******************************************************************************
11642 /* Function:
11643  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11644  DMA_CHANNEL dmaChannel,
11645  DMA_INT_TYPE dmaINTSource )
11646  Summary:
11647  Clears the interrupt flag of the specified DMA interrupt source
11648  for the specified channel.
11649  Description:
11650  This function clears the interrupt flag of the specified DMA interrupt source
11651  for the specified channel.
11652  Precondition:
11653  None.
11654  Parameters:
11655  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11656  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11657  Returns:
11658  None.
11659  Example:
11660  <code>
11661  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11662  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11663  spiDMAChannel,
11664  DMA_INT_ADDRESS_ERROR );
11665  </code>
11666  Remarks:
11667  This function implements an operation of the ChannelXINTSourceFlag feature.
11668  This feature may not be available on all devices. Please refer to the
11669  specific device data sheet to determine availability or use the
11670  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11671  determine whether this feature is available.
11672 */
11673 
11674 void
11676  DMA_MODULE_ID index ,
11677  DMA_CHANNEL dmaChannel ,
11678  DMA_INT_TYPE dmaINTSource ) ;
11679 //******************************************************************************
11680 /* Function:
11681  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11682  DMA_CHANNEL dmaChannel,
11683  DMA_INT_TYPE dmaINTSource )
11684  Summary:
11685  Enables the specified interrupt source for the specified channel.
11686  Description:
11687  This function enables the specified interrupt source for the specified channel.
11688  Precondition:
11689  None.
11690  Parameters:
11691  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11692  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11693  Returns:
11694  None.
11695  Example:
11696  <code>
11697  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11698  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11699  spiDMAChannel,
11700  DMA_INT_ADDRESS_ERROR );
11701  </code>
11702  Remarks:
11703  This function implements an operation of the ChannelXINTSource feature.
11704  This feature may not be available on all devices. Please refer to the
11705  specific device data sheet to determine availability or use the
11706  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11707  determine whether this feature is available.
11708 */
11709 
11710 void
11712  DMA_MODULE_ID index ,
11713  DMA_CHANNEL dmaChannel ,
11714  DMA_INT_TYPE dmaINTSource ) ;
11715 //******************************************************************************
11716 /* Function:
11717  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11718  DMA_CHANNEL dmaChannel,
11719  DMA_INT_TYPE dmaINTSource )
11720  Summary:
11721  Disables the specified interrupt source for the specified channel.
11722  Description:
11723  This function disables the specified interrupt source for the specified channel.
11724  Precondition:
11725  None.
11726  Parameters:
11727  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11728  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11729  Returns:
11730  None.
11731  Example:
11732  <code>
11733  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11734  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11735  spiDMAChannel,
11736  DMA_INT_ADDRESS_ERROR );
11737  </code>
11738  Remarks:
11739  This function implements an operation of the ChannelXINTSource feature.
11740  This feature may not be available on all devices. Please refer to the
11741  specific device data sheet to determine availability or use the
11742  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11743  determine whether this feature is available.
11744 */
11745 
11746 void
11748  DMA_MODULE_ID index ,
11749  DMA_CHANNEL dmaChannel ,
11750  DMA_INT_TYPE dmaINTSource ) ;
11751 //******************************************************************************
11752 /* Function:
11753  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11754  DMA_CHANNEL dmaChannel,
11755  DMA_INT_TYPE dmaINTSource )
11756  Summary:
11757  Returns the enable status of the specified interrupt source for the specified channel.
11758  Description:
11759  This function returns the enable status of the specified interrupt source for the
11760  specified channel.
11761  Precondition:
11762  None.
11763  Parameters:
11764  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11765  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11766  Returns:
11767  - true - The interrupt is enabled
11768  - false - The interrupt is not enabled
11769  Example:
11770  <code>
11771  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11772  bool dmaINTSourceEnableStatus;
11773  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11774  DMA_ID_0,
11775  spiDMAChannel,
11776  DMA_INT_ADDRESS_ERROR );
11777  </code>
11778  Remarks:
11779  This function implements an operation of the ChannelXINTSource feature.
11780  This feature may not be available on all devices. Please refer to the
11781  specific device data sheet to determine availability or use the
11782  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11783  determine whether this feature is available.
11784 */
11785 
11786 bool
11788  DMA_MODULE_ID index ,
11789  DMA_CHANNEL dmaChannel ,
11790  DMA_INT_TYPE dmaINTSource ) ;
11791 //******************************************************************************
11792 /* Function:
11793  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11794  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11795  Summary:
11796  Sets the pattern match length.
11797  Description:
11798  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11799  Precondition:
11800  None.
11801  Parameters:
11802  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11803  patternLen - Length of pattern match (either 1 or 2)
11804  Returns:
11805  None.
11806  Example:
11807  <code>
11808  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11809  DMA_PATTERN_LENGTH patternLen;
11810  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11811  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11812  </code>
11813  Remarks:
11814  This function implements an operation of the ChannelXPatternLength feature.
11815  This feature may not be available on all devices. Please refer to the
11816  specific device data sheet to determine availability or use the
11817  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11818  determine whether this feature is available.
11819 */
11820 
11821 void
11823  DMA_MODULE_ID index ,
11824  DMA_CHANNEL dmaChannel ,
11825  DMA_PATTERN_LENGTH patternLen ) ;
11826 //******************************************************************************
11827 /* Function:
11828  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11829  DMA_CHANNEL dmaChannel);
11830  Summary:
11831  Returns the pattern match length.
11832  Description:
11833  This function returns the length of the byte matching the CHPIGN bits during a
11834  pattern match that may be ignored during the pattern match determination when
11835  the CHPIGNEN bit is set.
11836  Precondition:
11837  None.
11838  Parameters:
11839  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11840  Returns:
11841  - patternLen - Length of pattern match (either 1 or 2)
11842  Example:
11843  <code>
11844  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11845  DMA_PATTERN_LENGTH patternLen;
11846  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11847  </code>
11848  Remarks:
11849  This function implements an operation of the ChannelXPatternLength feature.
11850  This feature may not be available on all devices. Please refer to the
11851  specific device data sheet to determine availability or use the
11852  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11853  determine whether this feature is available.
11854 */
11855 
11856 DMA_PATTERN_LENGTH
11858  DMA_MODULE_ID index ,
11859  DMA_CHANNEL dmaChannel ) ;
11860 //******************************************************************************
11861 /* Function:
11862  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11863  DMA_CHANNEL channel );
11864  Summary:
11865  Enables the pattern match ignore byte.
11866  Description:
11867  This function enables the pattern match ignore byte.
11868  Precondition:
11869  None.
11870  Parameters:
11871  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11872  Returns:
11873  None.
11874  Example:
11875  <code>
11876  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11877  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11878  </code>
11879  Remarks:
11880  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11881  This feature may not be available on all devices. Please refer to the
11882  specific device data sheet to determine availability or use the
11883  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11884  determine whether this feature is available.
11885 */
11886 
11887 void
11889  DMA_MODULE_ID index ,
11890  DMA_CHANNEL channel ) ;
11891 //******************************************************************************
11892 /* Function:
11893  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11894  DMA_CHANNEL channel );
11895  Summary:
11896  Returns the state of the pattern match ignore byte.
11897  Description:
11898  This function returns the state (enabled or disabled) of the pattern match
11899  ignore byte.
11900  Precondition:
11901  None.
11902  Parameters:
11903  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11904  Returns:
11905  - true - The pattern match ignore byte is enabled
11906  - false - The pattern match ignore byte is disabled
11907  Example:
11908  <code>
11909  bool patternIsEnabled;
11910  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11911  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
11912  </code>
11913  Remarks:
11914  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11915  This feature may not be available on all devices. Please refer to the
11916  specific device data sheet to determine availability or use the
11917  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11918  determine whether this feature is available.
11919 */
11920 
11921 bool
11923  DMA_MODULE_ID index ,
11924  DMA_CHANNEL channel ) ;
11925 //******************************************************************************
11926 /* Function:
11927  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
11928  DMA_CHANNEL channel );
11929  Summary:
11930  Disables the pattern match ignore byte.
11931  Description:
11932  This function disables the pattern match ignore byte.
11933  Precondition:
11934  None.
11935  Parameters:
11936  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11937  Returns:
11938  None.
11939  Example:
11940  <code>
11941  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11942  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
11943  </code>
11944  Remarks:
11945  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11946  This feature may not be available on all devices. Please refer to the
11947  specific device data sheet to determine availability or use the
11948  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11949  determine whether this feature is available.
11950 */
11951 
11952 void
11954  DMA_MODULE_ID index ,
11955  DMA_CHANNEL channel ) ;
11956 //******************************************************************************
11957 /* Function:
11958  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
11959  DMA_CHANNEL channel, uint8_t pattern );
11960  Summary:
11961  Sets the pattern match ignore value.
11962  Description:
11963  This function sets the value of the pattern match ignore.
11964  Precondition:
11965  None.
11966  Parameters:
11967  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11968  pattern - Pattern match ignore value
11969  Returns:
11970  None.
11971  Example:
11972  <code>
11973  uint8_t patternMatch = 0x8;
11974  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11975  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
11976  </code>
11977  Remarks:
11978  This function implements an operation of the ChannelXPatternIgnore feature.
11979  This feature may not be available on all devices. Please refer to the
11980  specific device data sheet to determine availability or use the
11981  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11982  determine whether this feature is available.
11983 */
11984 
11985 void
11987  DMA_MODULE_ID index ,
11988  DMA_CHANNEL channel ,
11989  uint8_t pattern ) ;
11990 //******************************************************************************
11991 /* Function:
11992  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
11993  DMA_CHANNEL channel );
11994  Summary:
11995  Returns the pattern match ignore value.
11996  Description:
11997  This function returns the value of the pattern match ignore.
11998  Precondition:
11999  None.
12000  Parameters:
12001  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12002  Returns:
12003  - uint8_t - Pattern match ignore value
12004  Example:
12005  <code>
12006  uint8_t patternMatch;
12007  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12008  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12009  </code>
12010  Remarks:
12011  This function implements an operation of the ChannelXPatternIgnore feature.
12012  This feature may not be available on all devices. Please refer to the
12013  specific device data sheet to determine availability or use the
12014  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12015  determine whether this feature is available.
12016 */
12017 
12018 uint8_t
12020  DMA_MODULE_ID index ,
12021  DMA_CHANNEL channel ) ;
12022 // *****************************************************************************
12023 // *****************************************************************************
12024 // Section: DMA Peripheral Library Exists API Routines
12025 // *****************************************************************************
12026 // *****************************************************************************
12027 /* The following functions indicate the existence of the features on the device.
12028 */
12029 //******************************************************************************
12030 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12031  Summary:
12032  Identifies whether the Busy feature exists on the DMA module.
12033  Description:
12034  This function identifies whether the Busy feature is available on the
12035  DMA module.
12036  When this function returns true, these functions are supported on the device:
12037  - PLIB_DMA_BusyActiveSet
12038  - PLIB_DMA_BusyActiveReset
12039  - PLIB_DMA_IsBusy
12040  Preconditions:
12041  None.
12042  Parameters:
12043  index - Identifier for the device instance
12044  Returns:
12045  - true - The Busy feature is supported on the device
12046  - false - The Busy feature is not supported on the device
12047  Remarks:
12048  None.
12049 */
12050 
12051 bool
12053  DMA_MODULE_ID index ) ;
12054 //******************************************************************************
12055 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12056  Summary:
12057  Identifies whether the Suspend feature exists on the DMA module.
12058  Description:
12059  This function identifies whether the Suspend feature is available on the
12060  DMA module.
12061  When this function returns true, these functions are supported on the device:
12062  - PLIB_DMA_SuspendEnable
12063  - PLIB_DMA_SuspendDisable
12064  - PLIB_DMA_SuspendIsEnabled
12065  Preconditions:
12066  None.
12067  Parameters:
12068  index - Identifier for the device instance
12069  Returns:
12070  - true - The Suspend feature is supported on the device
12071  - false - The Suspend feature is not supported on the device
12072  Remarks:
12073  None.
12074 */
12075 
12076 bool
12078  DMA_MODULE_ID index ) ;
12079 //******************************************************************************
12080 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12081  Summary:
12082  Identifies whether the StopInIdle feature exists on the DMA module.
12083  Description:
12084  This function identifies whether the StopInIdle feature is available on the
12085  DMA module.
12086  When this function returns true, these functions are supported on the device:
12087  - PLIB_DMA_StopInIdleEnable
12088  - PLIB_DMA_StopInIdleDisable
12089  Preconditions:
12090  None.
12091  Parameters:
12092  index - Identifier for the device instance
12093  Returns:
12094  - true - The StopInIdle feature is supported on the device
12095  - false - The StopInIdle feature is not supported on the device
12096  Remarks:
12097  None.
12098 */
12099 
12100 bool
12102  DMA_MODULE_ID index ) ;
12103 //******************************************************************************
12104 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12105  Summary:
12106  Identifies whether the EnableControl feature exists on the DMA module.
12107  Description:
12108  This function identifies whether the EnableControl feature is available on
12109  the DMA module.
12110  When this function returns true, these functions are supported on the device:
12111  - PLIB_DMA_Enable
12112  - PLIB_DMA_Disable
12113  - PLIB_DMA_IsEnabled
12114  Preconditions:
12115  None.
12116  Parameters:
12117  index - Identifier for the device instance
12118  Returns:
12119  - true - The EnableControl feature is supported on the device
12120  - false - The EnableControl feature is not supported on the device
12121  Remarks:
12122  None.
12123 */
12124 
12125 bool
12127  DMA_MODULE_ID index ) ;
12128 //******************************************************************************
12129 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12130  Summary:
12131  Identifies whether the ChannelBits feature exists on the DMA module.
12132  Description:
12133  This function identifies whether the ChannelBits feature is available on the
12134  DMA module.
12135  When this function returns true, this function is supported on the device:
12136  - PLIB_DMA_ChannelBitsGet
12137  Preconditions:
12138  None.
12139  Parameters:
12140  index - Identifier for the device instance
12141  Returns:
12142  - true - The ChannelBits feature is supported on the device
12143  - false - The ChannelBits feature is not supported on the device
12144  Remarks:
12145  None.
12146 */
12147 
12148 bool
12150  DMA_MODULE_ID index ) ;
12151 //******************************************************************************
12152 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12153  Summary:
12154  Identifies whether the LastBusAccess feature exists on the DMA module.
12155  Description:
12156  This function identifies whether the LastBusAccess feature is available on the
12157  DMA module.
12158  When this function returns true, these functions are supported on the device:
12159  - PLIB_DMA_LastBusAccessIsRead
12160  - PLIB_DMA_LastBusAccessIsWrite
12161  Preconditions:
12162  None.
12163  Parameters:
12164  index - Identifier for the device instance
12165  Returns:
12166  - true - The LastBusAccess feature is supported on the device
12167  - false - The LastBusAccess feature is not supported on the device
12168  Remarks:
12169  None.
12170 */
12171 
12172 bool
12174  DMA_MODULE_ID index ) ;
12175 //******************************************************************************
12176 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12177  Summary:
12178  Identifies whether the RecentAddress feature exists on the DMA module.
12179  Description:
12180  This function identifies whether the RecentAddress feature is available on
12181  the DMA module.
12182  When this function returns true, this function is supported on the device:
12183  - PLIB_DMA_RecentAddressAccessed
12184  Preconditions:
12185  None.
12186  Parameters:
12187  index - Identifier for the device instance
12188  Returns:
12189  - true - The RecentAddress feature is supported on the device
12190  - false - The RecentAddress feature is not supported on the device
12191  Remarks:
12192  None.
12193 */
12194 
12195 bool
12197  DMA_MODULE_ID index ) ;
12198 //******************************************************************************
12199 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12200  Summary:
12201  Identifies whether the CRCChannel feature exists on the DMA module.
12202  Description:
12203  This function identifies whether the CRCChannel feature is available on the
12204  DMA module.
12205  When this function returns true, these functions are supported on the device:
12206  - PLIB_DMA_CRCChannelSelect
12207  - PLIB_DMA_CRCChannelGet
12208  Preconditions:
12209  None.
12210  Parameters:
12211  index - Identifier for the device instance
12212  Returns:
12213  - true - The CRCChannel feature is supported on the device
12214  - false - The CRCChannel feature is not supported on the device
12215  Remarks:
12216  None.
12217 */
12218 
12219 bool
12221  DMA_MODULE_ID index ) ;
12222 //******************************************************************************
12223 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12224  Summary:
12225  Identifies whether the CRCType feature exists on the DMA module.
12226  Description:
12227  This function identifies whether the CRCType feature is available on the
12228  DMA module.
12229  When this function returns true, these functions are supported on the device:
12230  - PLIB_DMA_CRCTypeGet
12231  - PLIB_DMA_CRCTypeSet
12232  Preconditions:
12233  None.
12234  Parameters:
12235  index - Identifier for the device instance
12236  Returns:
12237  - true - The CRCType feature is supported on the device
12238  - false - The CRCType feature is not supported on the device
12239  Remarks:
12240  None.
12241 */
12242 
12243 bool
12245  DMA_MODULE_ID index ) ;
12246 //******************************************************************************
12247 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12248  Summary:
12249  Identifies whether the CRCAppendMode feature exists on the DMA module.
12250  Description:
12251  This function identifies whether the CRCAppendMode feature is available on
12252  the DMA module.
12253  When this function returns true, these functions are supported on the device:
12254  - PLIB_DMA_CRCAppendModeEnable
12255  - PLIB_DMA_CRCAppendModeDisable
12256  - PLIB_DMA_CRCAppendModeIsEnabled
12257  Preconditions:
12258  None.
12259  Parameters:
12260  index - Identifier for the device instance
12261  Returns:
12262  - true - The CRCAppendMode feature is supported on the device
12263  - false - The CRCAppendMode feature is not supported on the device
12264  Remarks:
12265  None.
12266 */
12267 
12268 bool
12270  DMA_MODULE_ID index ) ;
12271 //******************************************************************************
12272 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12273  Summary:
12274  Identifies whether the CRC feature exists on the DMA module.
12275  Description:
12276  This function identifies whether the CRC feature is available on the DMA module.
12277  When this function returns true, these functions are supported on the device:
12278  - PLIB_DMA_CRCEnable
12279  - PLIB_DMA_CRCDisable
12280  - PLIB_DMA_CRCIsEnabled
12281  Preconditions:
12282  None.
12283  Parameters:
12284  index - Identifier for the device instance
12285  Returns:
12286  - true - The CRC feature is supported on the device
12287  - false - The CRC feature is not supported on the device
12288  Remarks:
12289  None.
12290 */
12291 
12292 bool
12294  DMA_MODULE_ID index ) ;
12295 //******************************************************************************
12296 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12297  Summary:
12298  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12299  Description:
12300  This function identifies whether the CRCPolynomialLength feature is available
12301  on the DMA module.
12302  When this function returns true, these functions are supported on the device:
12303  - PLIB_DMA_CRCPolynomialLengthSet
12304  - PLIB_DMA_CRCPolynomialLengthGet
12305  Preconditions:
12306  None.
12307  Parameters:
12308  index - Identifier for the device instance
12309  Returns:
12310  - true - The CRCPolynomialLength feature is supported on the device
12311  - false - The CRCPolynomialLength feature is not supported on the device
12312  Remarks:
12313  None.
12314 */
12315 
12316 bool
12318  DMA_MODULE_ID index ) ;
12319 //******************************************************************************
12320 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12321  Summary:
12322  Identifies whether the CRCBitOrder feature exists on the DMA module.
12323  Description:
12324  This function identifies whether the CRCBitOrder feature is available on the
12325  DMA module.
12326  When this function returns true, this function is supported on the device:
12327  - PLIB_DMA_CRCBitOrderSelect
12328  Preconditions:
12329  None.
12330  Parameters:
12331  index - Identifier for the device instance
12332  Returns:
12333  - true - The CRCBitOrder feature is supported on the device
12334  - false - The CRCBitOrder feature is not supported on the device
12335  Remarks:
12336  None.
12337 */
12338 
12339 bool
12341  DMA_MODULE_ID index ) ;
12342 //******************************************************************************
12343 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12344  Summary:
12345  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12346  Description:
12347  This function identifies whether the CRCWriteByteOrder feature is available
12348  on the DMA module.
12349  When this function returns true, these functions are supported on the device:
12350  - PLIB_DMA_CRCWriteByteOrderAlter
12351  - PLIB_DMA_CRCWriteByteOrderMaintain
12352  Preconditions:
12353  None.
12354  Parameters:
12355  index - Identifier for the device instance
12356  Returns:
12357  - true - The CRCWriteByteOrder feature is supported on the device
12358  - false - The CRCWriteByteOrder feature is not supported on the device
12359  Remarks:
12360  None.
12361 */
12362 
12363 bool
12365  DMA_MODULE_ID index ) ;
12366 //******************************************************************************
12367 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12368  Summary:
12369  Identifies whether the CRCByteOrder feature exists on the DMA module.
12370  Description:
12371  This function identifies whether the CRCByteOrder feature is available on
12372  the DMA module.
12373  When this function returns true, these functions are supported on the device:
12374  - PLIB_DMA_CRCByteOrderSelect
12375  - PLIB_DMA_CRCByteOrderGet
12376  Preconditions:
12377  None.
12378  Parameters:
12379  index - Identifier for the device instance
12380  Returns:
12381  - true - The CRCByteOrder feature is supported on the device
12382  - false - The CRCByteOrder feature is not supported on the device
12383  Remarks:
12384  None.
12385 */
12386 
12387 bool
12389  DMA_MODULE_ID index ) ;
12390 //******************************************************************************
12391 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12392  Summary:
12393  Identifies whether the CRCData feature exists on the DMA module.
12394  Description:
12395  This function identifies whether the CRCData feature is available on the
12396  DMA module.
12397  When this function returns true, these functions are supported on the device:
12398  - PLIB_DMA_CRCDataRead
12399  - PLIB_DMA_CRCDataWrite
12400  Preconditions:
12401  None.
12402  Parameters:
12403  index - Identifier for the device instance
12404  Returns:
12405  - true - The CRCData feature is supported on the device
12406  - false - The CRCData feature is not supported on the device
12407  Remarks:
12408  None.
12409 */
12410 
12411 bool
12413  DMA_MODULE_ID index ) ;
12414 //******************************************************************************
12415 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12416  Summary:
12417  Identifies whether the CRCXOREnable feature exists on the DMA module.
12418  Description:
12419  This function identifies whether the CRCXOREnable feature is available on the
12420  DMA module.
12421  When this function returns true, these functions are supported on the device:
12422  - PLIB_DMA_CRCXOREnableSet
12423  - PLIB_DMA_CRCXOREnableGet
12424  Preconditions:
12425  None.
12426  Parameters:
12427  index - Identifier for the device instance
12428  Returns:
12429  - true - The CRCXOREnable feature is supported on the device
12430  - false - The CRCXOREnable feature is not supported on the device
12431  Remarks:
12432  None.
12433 */
12434 
12435 bool
12437  DMA_MODULE_ID index ) ;
12438 //******************************************************************************
12439 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12440  Summary:
12441  Identifies whether the ChannelXPriority feature exists on the DMA module.
12442  Description:
12443  This function identifies whether the ChannelXPriority feature is available on
12444  the DMA module.
12445  When this function returns true, these functions are supported on the device:
12446  - PLIB_DMA_ChannelXPrioritySelect
12447  - PLIB_DMA_ChannelXPriorityGet
12448  Preconditions:
12449  None.
12450  Parameters:
12451  index - Identifier for the device instance
12452  Returns:
12453  - true - The ChannelXPriority feature is supported on the device
12454  - false - The ChannelXPriority feature is not supported on the device
12455  Remarks:
12456  None.
12457 */
12458 
12459 bool
12461  DMA_MODULE_ID index ) ;
12462 //******************************************************************************
12463 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12464  Summary:
12465  Identifies whether the ChannelXEvent feature exists on the DMA module.
12466  Description:
12467  This function identifies whether the ChannelXEvent feature is available on
12468  the DMA module.
12469  When this function returns true, this function is supported on the device:
12470  - PLIB_DMA_ChannelXEventIsDetected
12471  Preconditions:
12472  None.
12473  Parameters:
12474  index - Identifier for the device instance
12475  Returns:
12476  - true - The ChannelXEvent feature is supported on the device
12477  - false - The ChannelXEvent feature is not supported on the device
12478  Remarks:
12479  None.
12480 */
12481 
12482 bool
12484  DMA_MODULE_ID index ) ;
12485 //******************************************************************************
12486 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12487  Summary:
12488  Identifies whether the ChannelXAuto feature exists on the DMA module.
12489  Description:
12490  This function identifies whether the ChannelXAuto feature is available on
12491  the DMA module.
12492  When this function returns true, these functions are supported on the device:
12493  - PLIB_DMA_ChannelXAutoEnable
12494  - PLIB_DMA_ChannelXAutoDisable
12495  - PLIB_DMA_ChannelXAutoIsEnabled
12496  Preconditions:
12497  None.
12498  Parameters:
12499  index - Identifier for the device instance
12500  Returns:
12501  - true - The ChannelXAuto feature is supported on the device
12502  - false - The ChannelXAuto feature is not supported on the device
12503  Remarks:
12504  None.
12505 */
12506 
12507 bool
12509  DMA_MODULE_ID index ) ;
12510 //******************************************************************************
12511 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12512  Summary:
12513  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12514  Description:
12515  This function identifies whether the ChannelXChainEnbl feature is available
12516  on the DMA module.
12517  When this function returns true, these functions are supported on the device:
12518  - PLIB_DMA_ChannelXChainEnable
12519  - PLIB_DMA_ChannelXChainDisable
12520  - PLIB_DMA_ChannelXChainIsEnabled
12521  Preconditions:
12522  None.
12523  Parameters:
12524  index - Identifier for the device instance
12525  Returns:
12526  - true - The ChannelXChainEnbl feature is supported on the device
12527  - false - The ChannelXChainEnbl feature is not supported on the device
12528  Remarks:
12529  None.
12530 */
12531 
12532 bool
12534  DMA_MODULE_ID index ) ;
12535 //******************************************************************************
12536 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12537  Summary:
12538  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12539  Description:
12540  This function identifies whether the ChannelXDisabled feature is available
12541  on the DMA module.
12542  When this function returns true, these functions are supported on the device:
12543  - PLIB_DMA_ChannelXDisabledEnablesEvents
12544  - PLIB_DMA_ChannelXDisabledDisablesEvents
12545  Preconditions:
12546  None.
12547  Parameters:
12548  index - Identifier for the device instance
12549  Returns:
12550  - true - The ChannelXDisabled feature is supported on the device
12551  - false - The ChannelXDisabled feature is not supported on the device
12552  Remarks:
12553  None.
12554 */
12555 
12556 bool
12558  DMA_MODULE_ID index ) ;
12559 //******************************************************************************
12560 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12561  Summary:
12562  Identifies whether the ChannelX feature exists on the DMA module.
12563  Description:
12564  This function identifies whether the ChannelX feature is available on the
12565  DMA module.
12566  When this function returns true, these functions are supported on the device:
12567  - PLIB_DMA_ChannelXEnable
12568  - PLIB_DMA_ChannelXIsEnabled
12569  - PLIB_DMA_ChannelXDisable
12570  Preconditions:
12571  None.
12572  Parameters:
12573  index - Identifier for the device instance
12574  Returns:
12575  - true - The ChannelX feature is supported on the device
12576  - false - The ChannelX feature is not supported on the device
12577  Remarks:
12578  None.
12579 */
12580 
12581 bool
12583  DMA_MODULE_ID index ) ;
12584 //******************************************************************************
12585 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12586  Summary:
12587  Identifies whether the ChannelXChain feature exists on the DMA module.
12588  Description:
12589  This function identifies whether the ChannelXChain feature is available on the
12590  DMA module.
12591  When this function returns true, these functions are supported on the device:
12592  - PLIB_DMA_ChannelXChainToLower
12593  - PLIB_DMA_ChannelXChainToHigher
12594  Preconditions:
12595  None.
12596  Parameters:
12597  index - Identifier for the device instance
12598  Returns:
12599  - true - The ChannelXChain feature is supported on the device
12600  - false - The ChannelXChain feature is not supported on the device
12601  Remarks:
12602  None.
12603 */
12604 
12605 bool
12607  DMA_MODULE_ID index ) ;
12608 //******************************************************************************
12609 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12610  Summary:
12611  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12612  Description:
12613  This function identifies whether the ChannelXPatternLength feature is available
12614  on the DMA module.
12615  When this function returns true, these functions are supported on the device:
12616  - PLIB_DMA_ChannelXPatternLengthSet
12617  - PLIB_DMA_ChannelXPatternLengthGet
12618  Preconditions:
12619  None.
12620  Parameters:
12621  index - Identifier for the device instance
12622  Returns:
12623  - true - The ChannelXPatternLength feature is supported on the device
12624  - false - The ChannelXPatternLength feature is not supported on the device
12625  Remarks:
12626  None.
12627 */
12628 
12629 bool
12631  DMA_MODULE_ID index ) ;
12632 //******************************************************************************
12633 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12634  Summary:
12635  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12636  module.
12637  Description:
12638  This function identifies whether the ChannelXPatternIgnoreByte feature is
12639  available on the DMA module.
12640  When this function returns true, these functions are supported on the device:
12641  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12642  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12643  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12644  Preconditions:
12645  None.
12646  Parameters:
12647  index - Identifier for the device instance
12648  Returns:
12649  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12650  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12651  Remarks:
12652  None.
12653 */
12654 
12655 bool
12657  DMA_MODULE_ID index ) ;
12658 //******************************************************************************
12659 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12660  Summary:
12661  Identifies whether the ChannelXBusy feature exists on the DMA module.
12662  Description:
12663  This function identifies whether the ChannelXBusy feature is available on the
12664  DMA module.
12665  When this function returns true, these functions are supported on the device:
12666  - PLIB_DMA_ChannelXBusyActiveSet
12667  - PLIB_DMA_ChannelXBusyInActiveSet
12668  - PLIB_DMA_ChannelXBusyIsBusy
12669  Preconditions:
12670  None.
12671  Parameters:
12672  index - Identifier for the device instance
12673  Returns:
12674  - true - The ChannelXBusy feature is supported on the device
12675  - false - The ChannelXBusy feature is not supported on the device
12676  Remarks:
12677  None.
12678 */
12679 
12680 bool
12682  DMA_MODULE_ID index ) ;
12683 //******************************************************************************
12684 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12685  Summary:
12686  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12687  Description:
12688  This function identifies whether the ChannelXPatternIgnore feature is available
12689  on the DMA module.
12690  When this function returns true, these functions are supported on the device:
12691  - PLIB_DMA_ChannelXPatternIgnoreSet
12692  - PLIB_DMA_ChannelXPatternIgnoreGet
12693  Preconditions:
12694  None.
12695  Parameters:
12696  index - Identifier for the device instance
12697  Returns:
12698  - true - The ChannelXPatternIgnore feature is supported on the device
12699  - false - The ChannelXPatternIgnore feature is not supported on the device
12700  Remarks:
12701  None.
12702 */
12703 
12704 bool
12706  DMA_MODULE_ID index ) ;
12707 //******************************************************************************
12708 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12709  Summary:
12710  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12711  Description:
12712  This function identifies whether the ChannelXTrigger feature is available on
12713  the DMA module.
12714  When this function returns true, these functions are supported on the device:
12715  - PLIB_DMA_ChannelXTriggerEnable
12716  - PLIB_DMA_ChannelXTriggerIsEnabled
12717  - PLIB_DMA_ChannelXTriggerDisable
12718  Preconditions:
12719  None.
12720  Parameters:
12721  index - Identifier for the device instance
12722  Returns:
12723  - true - The ChannelXTrigger feature is supported on the device
12724  - false - The ChannelXTrigger feature is not supported on the device
12725  Remarks:
12726  None.
12727 */
12728 
12729 bool
12731  DMA_MODULE_ID index ) ;
12732 //******************************************************************************
12733 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12734  Summary:
12735  Identifies whether the AbortTransfer feature exists on the DMA module.
12736  Description:
12737  This function identifies whether the AbortTransfer feature is available on
12738  the DMA module.
12739  When this function returns true, this function is supported on the device:
12740  - PLIB_DMA_AbortTransferSet
12741  Preconditions:
12742  None.
12743  Parameters:
12744  index - Identifier for the device instance
12745  Returns:
12746  - true - The AbortTransfer feature is supported on the device
12747  - false - The AbortTransfer feature is not supported on the device
12748  Remarks:
12749  None.
12750 */
12751 
12752 bool
12754  DMA_MODULE_ID index ) ;
12755 //******************************************************************************
12756 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12757  Summary:
12758  Identifies whether the StartTransfer feature exists on the DMA module.
12759  Description:
12760  This function identifies whether the StartTransfer feature is available on
12761  the DMA module.
12762  When this function returns true, this function is supported on the device:
12763  - PLIB_DMA_StartTransferSet
12764  Preconditions:
12765  None.
12766  Parameters:
12767  index - Identifier for the device instance
12768  Returns:
12769  - true - The StartTransfer feature is supported on the device
12770  - false - The StartTransfer feature is not supported on the device
12771  Remarks:
12772  None.
12773 */
12774 
12775 bool
12777  DMA_MODULE_ID index ) ;
12778 //******************************************************************************
12779 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12780  Summary:
12781  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12782  Description:
12783  This function identifies whether the ChannelXStartIRQ feature is available
12784  on the DMA module.
12785  When this function returns true, this function is supported on the device:
12786  - PLIB_DMA_ChannelXStartIRQSet
12787  Preconditions:
12788  None.
12789  Parameters:
12790  index - Identifier for the device instance
12791  Returns:
12792  - true - The ChannelXStartIRQ feature is supported on the device
12793  - false - The ChannelXStartIRQ feature is not supported on the device
12794  Remarks:
12795  None.
12796 */
12797 
12798 bool
12800  DMA_MODULE_ID index ) ;
12801 //******************************************************************************
12802 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12803  Summary:
12804  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12805  Description:
12806  This function identifies whether the ChannelXAbortIRQ feature is available
12807  on the DMA module.
12808  When this function returns true, this function is supported on the device:
12809  - PLIB_DMA_ChannelXAbortIRQSet
12810  Preconditions:
12811  None.
12812  Parameters:
12813  index - Identifier for the device instance
12814  Returns:
12815  - true - The ChannelXAbortIRQ feature is supported on the device
12816  - false - The ChannelXAbortIRQ feature is not supported on the device
12817  Remarks:
12818  None.
12819 */
12820 
12821 bool
12823  DMA_MODULE_ID index ) ;
12824 //******************************************************************************
12825 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12826  Summary:
12827  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12828  Description:
12829  This function identifies whether the ChannelXINTSourceFlag feature is available
12830  on the DMA module.
12831  When this function returns true, these functions are supported on the device:
12832  - PLIB_DMA_ChannelXINTSourceFlagGet
12833  - PLIB_DMA_ChannelXINTSourceFlagSet
12834  - PLIB_DMA_ChannelXINTSourceFlagClear
12835  Preconditions:
12836  None.
12837  Parameters:
12838  index - Identifier for the device instance
12839  Returns:
12840  - true - The ChannelXINTSourceFlag feature is supported on the device
12841  - false - The ChannelXINTSourceFlag feature is not supported on the device
12842  Remarks:
12843  None.
12844 */
12845 
12846 bool
12848  DMA_MODULE_ID index ) ;
12849 //******************************************************************************
12850 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12851  Summary:
12852  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12853  Description:
12854  This function identifies whether the ChannelXINTSource feature is available
12855  on the DMA module.
12856  When this function returns true, these functions are supported on the device:
12857  - PLIB_DMA_ChannelXINTSourceEnable
12858  - PLIB_DMA_ChannelXINTSourceDisable
12859  - PLIB_DMA_ChannelXINTSourceIsEnabled
12860  Preconditions:
12861  None.
12862  Parameters:
12863  index - Identifier for the device instance
12864  Returns:
12865  - true - The ChannelXINTSource feature is supported on the device
12866  - false - The ChannelXINTSource feature is not supported on the device
12867  Remarks:
12868  None.
12869 */
12870 
12871 bool
12873  DMA_MODULE_ID index ) ;
12874 //******************************************************************************
12875 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12876  Summary:
12877  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12878  Description:
12879  This function identifies whether the ChannelXSourceStartAddress feature is available
12880  on the DMA module.
12881  When this function returns true, these functions are supported on the device:
12882  - PLIB_DMA_ChannelXSourceStartAddressGet
12883  - PLIB_DMA_ChannelXSourceStartAddressSet
12884  Preconditions:
12885  None.
12886  Parameters:
12887  index - Identifier for the device instance
12888  Returns:
12889  - true - The ChannelXSourceStartAddress feature is supported on the device
12890  - false - The ChannelXSourceStartAddress feature is not supported on the device
12891  Remarks:
12892  None.
12893 */
12894 
12895 bool
12897  DMA_MODULE_ID index ) ;
12898 //******************************************************************************
12899 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12900  Summary:
12901  Identifies whether the ChannelXDestinationStartAddress feature exists on
12902  the DMA module.
12903  Description:
12904  This function identifies whether the ChannelXDestinationStartAddress feature
12905  is available on the DMA module.
12906  When this function returns true, these functions are supported on the device:
12907  - PLIB_DMA_ChannelXDestinationStartAddressGet
12908  - PLIB_DMA_ChannelXDestinationStartAddressSet
12909  Preconditions:
12910  None.
12911  Parameters:
12912  index - Identifier for the device instance
12913  Returns:
12914  - true - The ChannelXDestinationStartAddress feature is supported on the device
12915  - false - The ChannelXDestinationStartAddress feature is not supported on the device
12916  Remarks:
12917  None.
12918 */
12919 
12920 bool
12922  DMA_MODULE_ID index ) ;
12923 //******************************************************************************
12924 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
12925  Summary:
12926  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
12927  Description:
12928  This function identifies whether the ChannelXSourceSize feature is available
12929  on the DMA module.
12930  When this function returns true, these functions are supported on the device:
12931  - PLIB_DMA_ChannelXSourceSizeGet
12932  - PLIB_DMA_ChannelXSourceSizeSet
12933  Preconditions:
12934  None.
12935  Parameters:
12936  index - Identifier for the device instance
12937  Returns:
12938  - true - The ChannelXSourceSize feature is supported on the device
12939  - false - The ChannelXSourceSize feature is not supported on the device
12940  Remarks:
12941  None.
12942 */
12943 
12944 bool
12946  DMA_MODULE_ID index ) ;
12947 //******************************************************************************
12948 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
12949  Summary:
12950  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
12951  Description:
12952  This function identifies whether the ChannelXDestinationSize feature is available
12953  on the DMA module.
12954  When this function returns true, these functions are supported on the device:
12955  - PLIB_DMA_ChannelXDestinationSizeGet
12956  - PLIB_DMA_ChannelXDestinationSizeSet
12957  Preconditions:
12958  None.
12959  Parameters:
12960  index - Identifier for the device instance
12961  Returns:
12962  - true - The ChannelXDestinationSize feature is supported on the device
12963  - false - The ChannelXDestinationSize feature is not supported on the device
12964  Remarks:
12965  None.
12966 */
12967 
12968 bool
12970  DMA_MODULE_ID index ) ;
12971 //******************************************************************************
12972 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
12973  Summary:
12974  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
12975  Description:
12976  This function identifies whether the ChannelXSourcePointer feature is available
12977  on the DMA module.
12978  When this function returns true, this function is supported on the device:
12979  - PLIB_DMA_ChannelXSourcePointerGet
12980  Preconditions:
12981  None.
12982  Parameters:
12983  index - Identifier for the device instance
12984  Returns:
12985  - true - The ChannelXSourcePointer feature is supported on the device
12986  - false - The ChannelXSourcePointer feature is not supported on the device
12987  Remarks:
12988  None.
12989 */
12990 
12991 bool
12993  DMA_MODULE_ID index ) ;
12994 //******************************************************************************
12995 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
12996  Summary:
12997  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
12998  Description:
12999  This function identifies whether the ChannelXDestinationPointer feature is available
13000  on the DMA module.
13001  When this function returns true, this function is supported on the device:
13002  - PLIB_DMA_ChannelXDestinationPointerGet
13003  Preconditions:
13004  None.
13005  Parameters:
13006  index - Identifier for the device instance
13007  Returns:
13008  - true - The ChannelXDestinationPointer feature is supported on the device
13009  - false - The ChannelXDestinationPointer feature is not supported on the device
13010  Remarks:
13011  None.
13012 */
13013 
13014 bool
13016  DMA_MODULE_ID index ) ;
13017 //******************************************************************************
13018 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13019  Summary:
13020  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13021  Description:
13022  This function identifies whether the ChannelXCellSize feature is available on
13023  the DMA module.
13024  When this function returns true, these functions are supported on the device:
13025  - PLIB_DMA_ChannelXCellSizeGet
13026  - PLIB_DMA_ChannelXCellSizeSet
13027  Preconditions:
13028  None.
13029  Parameters:
13030  index - Identifier for the device instance
13031  Returns:
13032  - true - The ChannelXCellSize feature is supported on the device
13033  - false - The ChannelXCellSize feature is not supported on the device
13034  Remarks:
13035  None.
13036 */
13037 
13038 bool
13040  DMA_MODULE_ID index ) ;
13041 //******************************************************************************
13042 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13043  Summary:
13044  Identifies whether the ChannelXCellProgressPointer feature exists on the
13045  DMA module.
13046  Description:
13047  This function identifies whether the ChannelXCellProgressPointer feature is
13048  available on the DMA module.
13049  When this function returns true, this function is supported on the device:
13050  - PLIB_DMA_ChannelXCellProgressPointerGet
13051  Preconditions:
13052  None.
13053  Parameters:
13054  index - Identifier for the device instance
13055  Returns:
13056  - true - The ChannelXCellProgressPointer feature is supported on the device
13057  - false - The ChannelXCellProgressPointer feature is not supported on the device
13058  Remarks:
13059  None.
13060 */
13061 
13062 bool
13064  DMA_MODULE_ID index ) ;
13065 //******************************************************************************
13066 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13067  Summary:
13068  Identifies whether the ChannelXPatternData feature exists on the DMA module
13069  Description:
13070  This function identifies whether the ChannelXPatternData feature is available
13071  on the DMA module.
13072  When this function returns true, these functions are supported on the device:
13073  - PLIB_DMA_ChannelXPatternDataGet
13074  - PLIB_DMA_ChannelXPatternDataSet
13075  Preconditions:
13076  None.
13077  Parameters:
13078  index - Identifier for the device instance
13079  Returns:
13080  - true - The ChannelXPatternData feature is supported on the device
13081  - false - The ChannelXPatternData feature is not supported on the device
13082  Remarks:
13083  None.
13084 */
13085 
13086 bool
13088  DMA_MODULE_ID index ) ;
13089 //DOM-IGNORE-BEGIN
13090 //DOM-IGNORE-END
13091  // #ifndef _PLIB_DMA_H
13092 /*******************************************************************************
13093  End of File
13094 */
13095 
13096 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13097 /* CLOSE_FILE Include File */
13098 
13099 // *****************************************************************************
13100 // *****************************************************************************
13101 // Section: Data Types
13102 // *****************************************************************************
13103 // *****************************************************************************
13104 // *****************************************************************************
13105 /* DMA System Service Channel None
13106  Summary:
13107  DMA channel none
13108  Description:
13109  This constant identifies the specification of no choice from client
13110  for allocating a particular DMA channel.
13111  Remarks:
13112  This constant should be used in place of hard-coded numeric literals.
13113 */
13114 //DOM-IGNORE-BEGIN
13115 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13116 //DOM-IGNORE-END
13117 // *****************************************************************************
13118 /* DMA System Service Channel Any
13119  Summary:
13120  Identifies the client specification to allocate any available DMA channel.
13121  Description:
13122  This constant identifies the specification by the client
13123  to allocate any available DMA channel.
13124  Remarks:
13125  This constant should be used in place of hard-coded numeric literals.
13126 */
13127 //DOM-IGNORE-BEGIN
13128 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13129 //DOM-IGNORE-END
13130 // *****************************************************************************
13131 /* DMA System Service Channel Count
13132  Summary:
13133  Identifies the maximum number of DMA channel handles to be defined.
13134  Description:
13135  This constant identifies the maximum number of DMA channel handles
13136  that should be defined.
13137  Remarks:
13138  This value is derived from device-specific header files defined as
13139  part of the peripheral libraries.
13140 */
13141 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13142 // *****************************************************************************
13143 /* DMA System Service Channel Handle
13144  Summary:
13145  Assigns the handle for requested channel.
13146  Description:
13147  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13148  function. This handle is associated with the channel number that is used for
13149  data transfer and it allows the application to track the data transfer.
13150  The channel handle once assigned to a client expires when the
13151  client calls SYS_DMA_ChannelRelease.
13152  exits.
13153  Remarks:
13154  None.
13155 */
13156 
13157 typedef
13158 uintptr_t
13160 // *****************************************************************************
13161 /* DMA System Service Invalid Channel Handle
13162  Summary:
13163  Defines an invalid channel handle.
13164  Description:
13165  This is the definition of an invalid channel handle. An invalid buffer handle
13166  is returned by SYS_DMA_ChannelAllocate function if the channel number
13167  request was not successful.
13168  Remarks:
13169  None.
13170 */
13171 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13172 // *****************************************************************************
13173 /* DMA stop in idle mode
13174  Summary:
13175  Enable/Disable DMA operations in Idle mode.
13176  Description:
13177  This data type allows enabling/disabling of DMA operations in idle mode.
13178  Remarks:
13179  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13180  while initializing the DMA module by calling SYS_DMA_Initialize.
13181  This feature may not be available on all devices. Refer to the specific device
13182  data sheet to determine availability.
13183 */
13184 
13185 typedef
13186  enum
13187  {
13188  /* When the CPU enters idle mode, the DMA module continue operations */
13190  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13192  } SYS_DMA_SIDL ;
13193 // *****************************************************************************
13194 /* DMA Channel chaining priority
13195  Summary:
13196  Identifies the priority of chaining channel.
13197  Description:
13198  This data type identifies the priority of chaining channel.
13199  Channel chaining priority identifies the channel that will be enabled
13200  on completion of block data transfer on the master channel.
13201  Remarks:
13202  None.
13203 */
13204 
13205 typedef
13206  enum
13207  {
13208  /* Chain to channel higher in natural priority */
13210  /* Chain to channel lower in natural priority */
13213 // *****************************************************************************
13214 /* DMA Channel ignore pattern match
13215  Summary:
13216  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13217  pattern.
13218  Description:
13219  This data type allows enabling/disabling the feature to ignore a byte
13220  between a 2-byte match abort pattern.
13221  Remarks:
13222  This feature may not be available on all devices. Refer to the specific device
13223  data sheet to determine availability.
13224 */
13225 
13226 typedef
13227  enum
13228  {
13229  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13231  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13234 // *****************************************************************************
13235 /* DMA channel CRC mode
13236  Summary:
13237  Identifies the operation mode of the CRC module.
13238  Description:
13239  This data type identifies CRC operating mode. The CRC computation can be
13240  in background mode or append mode.
13241  Remarks:
13242  None.
13243 */
13244 
13245 typedef
13246  enum
13247  {
13248  /* DMA reads the data from the source, passes it through the CRC module and
13249  writes it to the destination. the calculated CRC is left in the DCRCDATA
13250  register at the end of the block transfer. */
13252  /* DMA only feeds source data to the CRC module. it does not write source data
13253  to the destination address. When a block transfer complete or pattern abort
13254  event occur, The DMA writes the CRC value to the destination address */
13257 // *****************************************************************************
13258 /* DMA channel CRC write order
13259  Summary:
13260  Identifies altering/maintaining write order post CRC computation.
13261  Description:
13262  This data type identifies write byte order selection post CRC
13263  computation.
13264  Remarks:
13265  None.
13266 */
13267 
13268 typedef
13269  enum
13270  {
13271  /* Source data is written to the destination unchanged regardless
13272  of the selected pre-CRC byte order. */
13274  /* Source data is written to the destination reordered according
13275  to the selected pre-CRC byte order. */
13278 // *****************************************************************************
13279 /* DMA channel operation modes
13280  Summary:
13281  Identifies the available DMA operating modes.
13282  Description:
13283  This data type Identifies the available DMA operating modes.
13284  The supported DMA modes are not mutually exclusive, but can be simultaneously
13285  operational.
13286  Remarks:
13287  These supported DMA modes can be logically OR'd together. They are passed
13288  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13289 */
13290 
13291 typedef
13292  enum
13293  {
13294  /* The normal DMA operation mode. The DMA channel will transfer data from
13295  a source to a destination without CPU intervention */
13296  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13297  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13298  ,
13299  /* Pattern Match abort mode allows the user to end a transfer if data
13300  written during a transaction matches a specific pattern, as defined by
13301  the DCHxDAT register */
13303  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13304  ,
13305  /* Channel chaining operating mode enhances the normal DMA channel
13306  operations. A channel(slave) can be chained to an adjacent channel(master).
13307  The slave channel will be enabled when a block transfer of the master
13308  channel completes. */
13309  /* only one of the below two chaining priorities must be provided.
13310  Chaining priority High. */
13312  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13313  ,
13314  /* Chaining priority Low */
13316  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13317  ,
13318  /* Auto enable operating mode allows a channel to be kept active, even if a
13319  block transfer completes or pattern match occurs. This prevents the user
13320  from having to re-enable the channel each time a block transfer completes. */
13321  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13322  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13323  ,
13324  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13325  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13326  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13328 // *****************************************************************************
13329 /* DMA channel CRC mode
13330  Summary:
13331  Defines the attributes for CRC operation mode.
13332  Description:
13333  This data type defines the attributes for CRC operation mode.
13334  Remarks:
13335  This feature may not be available on all devices. Refer to the specific device
13336  data sheet to determine availability.
13337 */
13338 
13339 typedef
13340  struct
13341  {
13342  /* CRC type (PLIB-level).
13343  Type Selection identifies whether the CRC module will calculate an IP
13344  header checksum or an LFSR CRC */
13345  DMA_CRC_TYPE type ;
13346  /* CRC mode, Background or Append */
13348  /* Polynomial length, This value is redundant when the selected CRC type is
13349  IP header checksum. When the CRC type is LFSR, Identifies the length of
13350  the polynomial. */
13351  uint8_t polyLength ;
13352  /* Bit order (PLIB-level).
13353  Identifies whether the CRC is computed LSb or MSb first */
13354  DMA_CRC_BIT_ORDER bitOrder ;
13355  /* Byte order (PLIB-level).
13356  Identifies the byte selection order input pre-CRC Generator. */
13357  DMA_CRC_BYTE_ORDER byteOrder ;
13358  /* Post CRC Write order */
13359  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13360  /* CRC data feed: While enabling the CRC mode, this field gives
13361  the seed for the CRC computation. On block transfer complete or
13362  pattern match abort the field have the computed CRC. */
13363  uint32_t data ;
13364  /* XOR bit mask, This value is redundant when the selected CRC type is
13365  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13366  bit mask input to the shift register during CRC computation. */
13367  uint32_t xorBitMask ;
13369 // *****************************************************************************
13370 /* DMA System service Events
13371  Summary:
13372  Enumeration of possible DMA System service events.
13373  Description:
13374  This data type provides an enumeration of all possible DMA System service events.
13375  Remarks:
13376  None.
13377 */
13378 
13379 typedef
13380  enum
13381  {
13382  /* Data was transferred successfully. */
13384  /* Error while processing the request */
13386  /* Data transfer was aborted. */
13388  /* No events yet. */
13391 // *****************************************************************************
13392 /* DMA System service Error
13393  Summary:
13394  Indicates the error information for the DMA System service.
13395  Description:
13396  This enumeration indicates the error information for the DMA System service.
13397  Remarks:
13398  None.
13399 */
13400 
13401 typedef
13402  enum
13403  {
13404  /* Data was transferred successfully. */
13405  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13406  = 1 << 0 ,
13407  /* DOM-IGNORE-END*/
13408  /* DMA address error. */
13409  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13410  = 1 << 1 /* DOM-IGNORE-END*/
13411  } SYS_DMA_ERROR ;
13412 // *****************************************************************************
13413 /* DMA Initialization data
13414  Summary:
13415  Defines the data required to initialize the DMA subsystem.
13416  Description:
13417  This data type defines the data required to initialize the DMA subsystem.
13418  Remarks:
13419  This feature may not be available on all devices. Refer to the specific device
13420  data sheet to determine availability.
13421 */
13422 
13423 typedef
13424  struct
13425  {
13426  /* Enable/Disable stop in idle mode feature */
13427  SYS_DMA_SIDL sidl ;
13428  } SYS_DMA_INIT ;
13429 // *****************************************************************************
13430 /* Data width options */
13431 
13432 typedef
13433  enum
13434  {
13435  /* Data width configuration feature is not available */
13437  } SYS_DMA_DATA_WIDTH ;
13438 // *****************************************************************************
13439 /* DMA descriptor control
13440  Summary:
13441  Defines the descriptor control for linked list operation.
13442  Description:
13443  This data type defines the descriptor control for linked list operation.
13444  Remarks:
13445  This feature may not be available on all devices. Refer to the specific device
13446  data sheet to determine availability.
13447 */
13448 
13449 typedef
13450  union
13451  {
13452  /* Feature is not supported */
13453  ;
13455 // *****************************************************************************
13456 // *****************************************************************************
13457 // Section: Initialization and Task Functions
13458 // *****************************************************************************
13459 // *****************************************************************************
13460 //******************************************************************************
13461 /* Function:
13462  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13463  Summary:
13464  Maintains the system service's state machine.
13465 
13466  Description:
13467  This function is used to maintain the DMA system service's internal state
13468  machine. This function services events on a specific DMA channel.
13469  Precondition:
13470  DMA should have been initialized by calling SYS_DMA_Initialize.
13471  Parameters:
13472  object - Object handle for the DMA module (returned from
13473  SYS_DMA_Initialize)
13474  activeChannel - DMA channel number to be serviced.
13475  Returns:
13476  None.
13477  Example:
13478  <code>
13479  // 'object' Returned from SYS_DMA_Initialize
13480  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13481  {
13482  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13483  }
13484  </code>
13485  Remarks:
13486  This function is normally not called directly by an application. It is
13487  called by the system's task/interrupt routines.
13488  */
13489 
13490 void
13491  SYS_DMA_Tasks (
13492  SYS_MODULE_OBJ object ,
13493  DMA_CHANNEL activeChannel ) ;
13494 //******************************************************************************
13495 /* For backward compatibility */
13496 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13497  // #ifndef _SYS_DMA_DEFINITIONS_H
13498 /*******************************************************************************
13499  End of File
13500 */
13501 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13502 /* CLOSE_FILE Include File */
13503 
13504 // DOM-IGNORE-BEGIN
13505 // DOM-IGNORE-END
13506 // *****************************************************************************
13507 // *****************************************************************************
13508 // Section: DMA System Service Interface Routines
13509 // *****************************************************************************
13510 // *****************************************************************************
13511 // *****************************************************************************
13512 /* DMA System service Transfer Event Handler Function
13513  Summary:
13514  Pointer to a DMA System service Transfer Event handler function.
13515  Description:
13516  This data type defines a DMA System service Transfer Event Handler Function.
13517  A DMA system service client must register an transfer event handler function of
13518  this type to receive transfer related events from the system service.
13519  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13520  was transferred successfully. The channelHandle parameter contains the channel
13521  handle of the channel on which the transfer was processed.
13522  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13523  not transferred successfully. TThe channelHandle parameter contains the channel
13524  handle of the channel on which the transfer had failed.
13525  The contextHandle parameter contains the context handle that was provided by
13526  the client at the time of registering the event handler. This context handle
13527  can be anything that the client consider helpful or necessary to identify
13528  the client context object associated with the channel of the system
13529  service that generated the event.
13530  The event handler function executes in an interrupt context when DMA is setup
13531  to start operation by an interrupt trigger source. It is recommended of the
13532  application to not perform process intensive operations with in this
13533  function.
13534  Remarks:
13535  None.
13536 */
13537 
13538 typedef
13540 SYS_DMA_CHANNEL_HANDLE handle ,
13541 uintptr_t contextHandle ) ;
13542 // *****************************************************************************
13543 // *****************************************************************************
13544 // Section: Initialization and Task Functions
13545 // *****************************************************************************
13546 // *****************************************************************************
13547 //******************************************************************************
13548 /* Function:
13549  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13550  Summary:
13551  Initializes and Enables the DMA Controller.
13552  Description:
13553  This function Enables the DMA module. Enable/Disable stop in idle mode
13554  feature based on the passed parameter value.
13555  This function initializes the DMA module making it ready for clients to
13556  open and use it. The initialization data is specified by the init parameter.
13557  Precondition:
13558  None.
13559  Parameters:
13560  init - Pointer to the data structure containing any data
13561  necessary to initialize the hardware. This pointer may
13562  be null if no data is required and default
13563  initialization is to be used.
13564  Returns:
13565  If successful, returns a valid handle to the DMA module object.
13566  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13567  Example:
13568  <code>
13569  SYS_MODULE_OBJ objectHandle;
13570  SYS_DMA_INIT initParam;
13571  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13572  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13573  (SYS_MODULE_INIT*)initParam);
13574  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13575  {
13576  // Handle error
13577  }
13578  </code>
13579  Remarks:
13580  This function must be called before any other DMA systems service routines
13581  are called.
13582  Not all features are available on all micro-controllers.
13583 */
13584 
13585 SYS_MODULE_OBJ
13587  const SYS_MODULE_INIT * const init ) ;
13588 // *****************************************************************************
13589 // *****************************************************************************
13590 // Section: Channel Setup and management functions
13591 // *****************************************************************************
13592 // *****************************************************************************
13593 //******************************************************************************
13594 /* Function:
13595  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13596  Summary:
13597  Allocates the specified DMA channel and returns a handle to it.
13598  Description:
13599  This function opens the specified DMA channel and provides a
13600  handle that must be provided to all other client-level operations to
13601  identify the caller and the DMA channel.
13602  Precondition:
13603  Function SYS_DMA_Initialize must have been called before calling this
13604  function.
13605  Parameters:
13606  channel - Channel number requested for allocation.
13607  When channel number specified is DMA_CHANNEL_ANY
13608  a random channel is allocated for DMA transfers.
13609  Returns:
13610  The channel handle for the requested channel number.
13611  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13612  Error can occur.
13613  - if the requested channel number is invalid.
13614  - if the requested channel number is not free.
13615  Example:
13616  <code>
13617  DMA_CHANNEL channel;
13618  SYS_DMA_CHANNEL_HANDLE handle
13619  channel = DMA_CHANNEL_2;
13620  handle = SYS_DMA_ChannelAllocate(channel);
13621  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13622  {
13623  // Failed to allocate the channel
13624  }
13625  else
13626  {
13627  // Proceed with setting up the channel and adding the transfer
13628  }
13629  </code>
13630  Remarks:
13631  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13632  This function must be called before any other DMA channel Setup and management
13633  routines are called
13634 */
13635 
13638  DMA_CHANNEL channel ) ;
13639 //******************************************************************************
13640 /* Function:
13641  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13642  Summary:
13643  Deallocates and frees the channel specified by the handle.
13644  Description:
13645  This function deallocates an allocated-channel of the DMA module,
13646  invalidating the handle.
13647  Precondition:
13648  DMA should have been initialized by calling SYS_DMA_Initialize.
13649  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13650  Parameters:
13651  handle - A valid allocated-channel handle, returned from the service's
13652  Allocate routine
13653  Returns:
13654  None.
13655  Example:
13656  <code>
13657  DMA_CHANNEL channel;
13658  SYS_DMA_CHANNEL_HANDLE handle;
13659  channel = DMA_CHANNEL_2;
13660  handle = SYS_DMA_ChannelAllocate(channel);
13661  SYS_DMA_ChannelRelease(handle);
13662  </code>
13663  Remarks:
13664  After calling this routine, the handle passed in "handle" must not be used
13665  with any of the remaining service's routines. A new handle must be obtained by
13666  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13667 */
13668 
13669 void
13671  SYS_DMA_CHANNEL_HANDLE handle ) ;
13672 //******************************************************************************
13673 /* Function:
13674  void SYS_DMA_ChannelSetup
13675  (
13676  SYS_DMA_CHANNEL_HANDLE handle,
13677  SYS_DMA_CHANNEL_OP_MODE modeEnable
13678  DMA_TRIGGER_SOURCE eventSrc
13679  )
13680  Summary:
13681  Setup the DMA channel parameters.
13682  Description:
13683  This function sets up the DMA channel parameters.
13684  It sets the channel priority and enables the mode of operations for the
13685  current system design.
13686  Precondition:
13687  DMA should have been initialized by calling SYS_DMA_Initialize.
13688  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13689  Parameters:
13690  handle - Handle of the DMA channel as returned by the
13691  SYS_DMA_ChannelAllocate function.
13692  priority - The priority to be associated to the channel.
13693  modeEnable - The supported operating modes to be enabled.
13694  This parameter can be logically ORed to specify
13695  multiple options.
13696  eventSrc - The event causing the cell transfer start.
13697  Returns:
13698  None.
13699  Example:
13700  <code>
13701  // 'handle' is a valid handle returned
13702  // by the SYS_DMA_ChannelAllocate function.
13703  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13704  DMA_TRIGGER_SOURCE eventSrc;
13705  channel = DMA_CHANNEL_2;
13706  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13707  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13708  // Setup channel number, and enables basic and CRC mode
13709  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13710  </code>
13711  Remarks:
13712  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13713  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13714  mode setup API's needs to be called to set the related parameters.
13715  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13716  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13717  Not all features are available on all microcontrollers.
13718  */
13719 
13720 void
13722  SYS_DMA_CHANNEL_HANDLE handle ,
13723  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13724  DMA_TRIGGER_SOURCE eventSrc ) ;
13725 //******************************************************************************
13726 /* Function:
13727  void SYS_DMA_ChannelSetupMatchAbortMode
13728  (
13729  SYS_DMA_CHANNEL_HANDLE handle,
13730  uint16_t pattern,
13731  DMA_PATTERN_LENGTH length,
13732  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13733  uint8_t ignorePattern
13734  )
13735  Summary:
13736  Setup the pattern match abort mode.
13737  Description:
13738  This function sets up the termination of DMA operation when the specified
13739  pattern is matched. Additionally on supported parts the function also
13740  sets up the ignoring of part of a pattern(8-bit) from match abort
13741  pattern(16-bit).
13742  Precondition:
13743  DMA should have been initialized by calling SYS_DMA_Initialize.
13744  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13745  The function SYS_DMA_ChannelSetup must be called to enable
13746  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13747  match mode features.
13748  Parameters:
13749  handle - Handle of the DMA channel as returned by the
13750  SYS_DMA_ChannelAllocate function.
13751  pattern - The pattern that needs to be matched to abort a DMA transfer.
13752  length - Match pattern length can be 1-byte or 2-byte.
13753  ignore - Enable/Disable a byte between a 2-byte pattern match.
13754  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13755  from the match abort pattern(16-bit)
13756  Returns:
13757  None.
13758  Example:
13759  <code>
13760  // Example 1
13761  // The following code is for a device with an 8-bit pattern value and no
13762  // support for pattern match ignore feature
13763  // 'handle' is a valid handle returned
13764  // by the SYS_DMA_ChannelAllocate function.
13765  uint16_t pattern;
13766  DMA_PATTERN_LENGTH length;
13767  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13768  uint8_t ignorePattern;
13769  pattern = 0x00; //Stop transfer on detection of a NULL character
13770  length = DMA_PATTERN_LENGTH_NONE;
13771  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13772  ignorePattern = 0;
13773  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13774  ignoreEnable, ignorePattern);
13775  // Example 2
13776  // The following code is for a device with a 16-bit pattern value and
13777  // support for pattern match ignore feature
13778  // 'handle' is a valid handle returned
13779  // by the SYS_DMA_ChannelAllocate function.
13780  uint16_t pattern;
13781  DMA_PATTERN_LENGTH length;
13782  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13783  uint8_t ignorePattern;
13784  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13785  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13786  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13787  ignorePattern = 0x00; \\ Any null character between the termination pattern
13788  \\ '\r' and '\n' is ignored.
13789  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13790  ignore, ignorePattern);
13791  </code>
13792  Remarks:
13793  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13794  Not all features are available on all devices.
13795  Refer to the specific device data sheet for details.
13796 */
13797 
13798 void
13800  SYS_DMA_CHANNEL_HANDLE handle ,
13801  uint16_t pattern ,
13802  DMA_PATTERN_LENGTH length ,
13804  uint8_t ignorePattern ) ;
13805 //******************************************************************************
13806 /* Function:
13807  void SYS_DMA_ChannelCRCSet
13808  (
13809  SYS_DMA_CHANNEL_HANDLE handle,
13810  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13811  )
13812  Summary:
13813  Sets up the CRC operation mode.
13814  Description:
13815  This function sets up the CRC computation features.
13816  Precondition:
13817  DMA should have been initialized by calling SYS_DMA_Initialize.
13818  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13819  The function SYS_DMA_ChannelSetup must be called to enable
13820  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13821  Parameters:
13822  handle - Handle of the DMA channel as returned by the
13823  SYS_DMA_ChannelAllocate function.
13824  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13825  crc.mode - Compute the CRC in Background/Append mode.
13826  crc.polyLength - Denotes the length of the polynomial.
13827  crc.bitOrder - CRC is calculated LSb/MSb first.
13828  crc.byteOrder - Byte selection order input pre-CRC Generator
13829  crc.writeOrder - Write byte order selection post-CRC computation
13830  crc.data - Computed/Seed CRC
13831  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13832  when mode is LFSR
13833  Returns:
13834  None.
13835  Example:
13836  <code>
13837  //Example 1
13838  // DMA calculation using the CRC background mode
13839  // 'handle' is a valid handle returned
13840  // by the SYS_DMA_ChannelAllocate function.
13841  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13842  crc.type = DMA_CRC_LFSR;
13843  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13844  crc.polyLength = 16;
13845  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13846  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13847  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13848  crc.data = 0xFFFF;
13849  crc.xorBitMask = 0x1021;
13850  SYS_DMA_ChannelCRCSet(handle, crc);
13851  </code>
13852  Remarks:
13853  This feature may not be available on all devices. Refer to the specific device
13854  data sheet to determine availability.
13855 */
13856 
13857 void
13859  SYS_DMA_CHANNEL_HANDLE handle ,
13861 //******************************************************************************
13862 /* Function:
13863  uint32_t SYS_DMA_ChannelCRCGet(void)
13864  Summary:
13865  Returns the computed CRC.
13866  Description:
13867  This function returns the computed CRC
13868  Precondition:
13869  DMA should have been initialized by calling SYS_DMA_Initialize.
13870  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13871  The function SYS_DMA_ChannelSetup must be called to enable
13872  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13873  The CRC generator must have been previously setup using
13874  SYS_DMA_ChannelCRCSet.
13875  Parameters:
13876  None
13877  Returns:
13878  uint32_t - The Computed CRC.
13879  Example:
13880  <code>
13881  uint32_t computedCRC;
13882  computedCRC = SYS_DMA_ChannelCRCGet();
13883  </code>
13884  Remarks:
13885  To get the computed CRC value this function must be called after the block
13886  transfer completion event (i.e., after getting and processing the callback
13887  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13888  This feature may not be available on all devices. Refer to the specific device
13889  data sheet to determine availability.
13890 */
13891 
13892 uint32_t
13893  SYS_DMA_ChannelCRCGet ( void ) ;
13894 //******************************************************************************
13895 /* Function:
13896  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13897  Summary:
13898  Enables a channel.
13899  Description:
13900  This function enables a channel.
13901  Precondition:
13902  DMA should have been initialized by calling SYS_DMA_Initialize.
13903  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13904  The function SYS_DMA_ChannelSetup must have been called to setup and
13905  enable the required features.
13906  Parameters:
13907  handle - Handle of the DMA channel as returned by the
13908  SYS_DMA_ChannelAllocate function.
13909  Returns:
13910  None.
13911  Example:
13912  <code>
13913  // 'handle' is a valid handle returned
13914  // by the SYS_DMA_ChannelAllocate function.
13915  SYS_DMA_ChannelEnable(handle);
13916  </code>
13917  Remarks:
13918  This function may not required to be called when starting DMA setup
13919  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
13920  But may be needed to be called in the registered callback to enable the
13921  channel and continue the data transfer with the existing transfer parameters
13922  previously set with 'SYS_DMA_ChannelTransferAdd'.
13923  The DMA channel is by default disabled on the completion of block
13924  transfer(callback generated)
13925 */
13926 
13927 void
13929  SYS_DMA_CHANNEL_HANDLE handle ) ;
13930 //******************************************************************************
13931 /* Function:
13932  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
13933  Summary:
13934  Disables a channel.
13935  Description:
13936  This function disables a channel.
13937  Precondition:
13938  DMA should have been initialized by calling SYS_DMA_Initialize.
13939  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13940  The function SYS_DMA_ChannelSetup must have been called to setup and
13941  enable the required features.
13942  A DMA channel should have been enabled either by calling
13943  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
13944  Parameters:
13945  handle - Handle of the DMA channel as returned by the
13946  SYS_DMA_ChannelAllocate function.
13947  Returns:
13948  None.
13949  Example:
13950  <code>
13951  // 'handle' is a valid handle returned
13952  // by the SYS_DMA_ChannelAllocate function.
13953  SYS_DMA_ChannelDisable(handle);
13954  </code>
13955  Remarks:
13956  None.
13957 */
13958 
13959 void
13961  SYS_DMA_CHANNEL_HANDLE handle ) ;
13962 //******************************************************************************
13963 /* Function:
13964  void SYS_DMA_ChannelTransferAdd
13965  (
13966  SYS_DMA_CHANNEL_HANDLE handle,
13967  const void *srcAddr, size_t srcSize
13968  const void *destAddr, size_t destSize,
13969  size_t cellSize
13970  )
13971  Summary:
13972  Adds a data transfer to a DMA channel and Enables the channel to start
13973  data transfer.
13974  Description:
13975  This function adds a data transfer characteristics for a DMA channel. The
13976  The source and the destination addresses, source and destination lengths,
13977  The number of bytes transferred per cell event are set. It also enables
13978  the channel to start data transfer.
13979  If the requesting client registered an event callback with the service,
13980  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
13981  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
13982  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
13983  processed successfully.
13984  Precondition:
13985  DMA should have been initialized by calling SYS_DMA_Initialize.
13986  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13987  The function SYS_DMA_ChannelSetup must have been called to setup and
13988  enable the required features.
13989  Parameters:
13990  handle - Handle of the DMA channel as returned by the
13991  SYS_DMA_ChannelAllocate function.
13992  srcAddr - Source of the DMA transfer
13993  srcSize - Size of the source
13994  destAddr - Destination of the DMA transfer
13995  destSize - Size of the destination
13996  cellSize - Size of the cell
13997  Returns:
13998  None.
13999  Example:
14000  <code>
14001  // Add 10 bytes of data transfer to UART TX
14002  // 'handle' is a valid handle returned
14003  // by the SYS_DMA_ChannelAllocate function.
14004  MY_APP_OBJ myAppObj;
14005  uint8_t buf[10];
14006  void *srcAddr;
14007  void *destAddr;
14008  size_t srcSize;
14009  size_t destSize;
14010  size_t cellSize;
14011  srcAddr = (uint8_t *) buf;
14012  srcSize = 10;
14013  destAddr = (uin8_t*) &U2TXREG;
14014  destSize = 1;
14015  cellSize = 1;
14016  // User registers an event handler with system service. This is done once
14017  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14018  (uintptr_t)&myAppObj);
14019  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14020  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14021  {
14022  // Error handling here
14023  }
14024  // Event Processing Technique. Event is received when
14025  // the transfer is processed.
14026  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14027  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14028  {
14029  switch(event)
14030  {
14031  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14032  // This means the data was transferred.
14033  break;
14034  case SYS_DMA_TRANSFER_EVENT_ERROR:
14035  // Error handling here.
14036  break;
14037  default:
14038  break;
14039  }
14040  }
14041  </code>
14042  Remarks:
14043  For PIC32MZ series of devices, if the source/destination addresses are
14044  RAM memory addresses, the the source/destination buffers
14045  should be made coherent to avoid the cache coherency issues.
14046  For example:
14047  <code>
14048  uint8_t buffer[1024];
14049  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14050  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14051  </code>
14052 */
14053 
14054 void
14056  SYS_DMA_CHANNEL_HANDLE handle ,
14057  const void * srcAddr ,
14058  size_t srcSize ,
14059  const void * destAddr ,
14060  size_t destSize ,
14061  size_t cellSize ) ;
14062 //******************************************************************************
14063 /* Function:
14064  void SYS_DMA_ChannelTransferSet
14065  (
14066  SYS_DMA_CHANNEL_HANDLE handle,
14067  const void *srcAddr, size_t srcSize
14068  const void *destAddr, size_t destSize,
14069  size_t cellSize
14070  )
14071  Summary:
14072  Sets up a data transfer to a DMA channel.
14073  Description:
14074  This function sets up data transfer characteristics for a DMA channel. The
14075  The source and the destination addresses, source and destination lengths,
14076  The number of bytes transferred per cell event are set.
14077  This function does not enables the DMA channel. The channel has to be explicitly
14078  enabled to start the data transfer.
14079  The above functions could be used in situations where in the user intends to
14080  setup transfer parameters but do not intend to enable the channel immediately.
14081  For example to chain to DMA channels in a cyclic order where the channels remains
14082  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14083  condition occurs.
14084  Precondition:
14085  DMA should have been initialized by calling SYS_DMA_Initialize.
14086  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14087  The function SYS_DMA_ChannelSetup must have been called to setup and
14088  enable the required features.
14089  Parameters:
14090  handle - Handle of the DMA channel as returned by the
14091  SYS_DMA_ChannelAllocate function.
14092  srcAddr - Source of the DMA transfer
14093  srcSize - Size of the source
14094  destAddr - Destination of the DMA transfer
14095  destSize - Size of the destination
14096  cellSize - Size of the cell
14097  Returns:
14098  None.
14099  Example:
14100  <code>
14101  // Set up 10 bytes of data transfer to UART TX
14102  // 'handle' is a valid handle returned
14103  // by the SYS_DMA_ChannelAllocate function.
14104  MY_APP_OBJ myAppObj;
14105  uint8_t buf[10];
14106  void *srcAddr;
14107  void *destAddr;
14108  size_t srcSize;
14109  size_t destSize;
14110  size_t cellSize;
14111  srcAddr = (uint8_t *) buf;
14112  srcSize = 10;
14113  destAddr = (uin8_t*) &U2TXREG;
14114  destSize = 1;
14115  cellSize = 1;
14116  // User registers an event handler with system service. This is done once
14117  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14118  (uintptr_t)&myAppObj);
14119  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14120  SYS_DMA_ChannelEnable(handle);
14121  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14122  {
14123  // Error handling here
14124  }
14125  // Event Processing Technique. Event is received when
14126  // the transfer is processed.
14127  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14128  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14129  {
14130  switch(event)
14131  {
14132  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14133  // This means the data was transferred.
14134  break;
14135  case SYS_DMA_TRANSFER_EVENT_ERROR:
14136  // Error handling here.
14137  break;
14138  default:
14139  break;
14140  }
14141  }
14142  </code>
14143  Remarks:
14144  For PIC32MZ series of devices, if the source/destination addresses are
14145  RAM memory addresses, the the source/destination buffers
14146  should be made coherent to avoid the cache coherency issues.
14147  For example:
14148  <code>
14149  uint8_t buffer[1024];
14150  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14151  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14152  </code>
14153 */
14154 
14155 void
14157  SYS_DMA_CHANNEL_HANDLE handle ,
14158  const void * srcAddr ,
14159  size_t srcSize ,
14160  const void * destAddr ,
14161  size_t destSize ,
14162  size_t cellSize ) ;
14163 //******************************************************************************
14164 /* Function:
14165  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14166  Summary:
14167  Returns the number of bytes transferred from source.
14168  Description:
14169  When a data transfer request is submitted. At any time while the transmission
14170  is in progress the size of the amount of data transferred from source
14171  can be known by calling this function.
14172  Precondition:
14173  DMA should have been initialized by calling SYS_DMA_Initialize.
14174  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14175  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14176  SYS_DMA_ChannelTransferSet.
14177  Parameters:
14178  handle - A valid channel handle, returned from the system service's
14179  Allocate routine
14180  Returns:
14181  size_t - Returns the number of bytes transferred from the submitted size.
14182  Example:
14183  <code>
14184  // 'handle' is a valid handle returned
14185  // by the SYS_DMA_ChannelAllocate function.
14186  MY_APP_OBJ myAppObj;
14187  uint8_t buf[10];
14188  void *srcAddr;
14189  void *destAddr;
14190  size_t srcSize;
14191  size_t destSize;
14192  size_t cellSize;
14193  size_t transferredSize;
14194  srcAddr = (uint8_t *) buf;
14195  srcSize = 10;
14196  destAddr = (uin8_t*) &U2TXREG;
14197  destSize = 1;
14198  cellSize = 1;
14199  channelHandle = SYS_DMA_ChannelAllocate(channel);
14200  // User registers an event handler with system service. This is done once
14201  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14202  (uintptr_t)&myAppObj);
14203  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14204  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14205  {
14206  // Error handling here
14207  }
14208  // The data is being transferred after adding the transfer to the DMA channel.
14209  // The user can get to know dynamically the amount of data
14210  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14211  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14212  </code>
14213  Remarks:
14214  None.
14215 */
14216 
14217 size_t
14219  SYS_DMA_CHANNEL_HANDLE handle ) ;
14220 //******************************************************************************
14221 /* Function:
14222  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14223  Summary:
14224  Returns the number of bytes transferred to destination.
14225  Description:
14226  When a data transfer request is submitted. At any time while the transmission
14227  is in progress the size of the amount of data transferred to destination
14228  can be known by calling this function.
14229  Precondition:
14230  DMA should have been initialized by calling SYS_DMA_Initialize.
14231  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14232  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14233  SYS_DMA_ChannelTransferSet.
14234  Parameters:
14235  handle - A valid channel handle, returned from the system service's
14236  Allocate routine
14237  Returns:
14238  size_t - Returns the number of bytes received from the submitted size.
14239  Example:
14240  <code>
14241  // 'handle' is a valid handle returned
14242  // by the SYS_DMA_ChannelAllocate function.
14243  MY_APP_OBJ myAppObj;
14244  uint8_t buf[10];
14245  void *srcAddr;
14246  void *destAddr;
14247  size_t srcSize;
14248  size_t destSize;
14249  size_t cellSize;
14250  size_t transferredSize;
14251  srcAddr = (uin8_t*) &U2RXREG;
14252  srcSize = 1;
14253  destAddr = (uint8_t *) buf ;
14254  destSize = 10;
14255  cellSize = 1;
14256  channelHandle = SYS_DMA_ChannelAllocate(channel);
14257  // User registers an event handler with system service. This is done once
14258  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14259  (uintptr_t)&myAppObj);
14260  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14261  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14262  {
14263  // Error handling here
14264  }
14265  // The data is being transferred after adding the transfer to the DMA channel.
14266  // The user can get to know dynamically the amount of data
14267  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14268  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14269  </code>
14270  Remarks:
14271  None.
14272 */
14273 
14274 size_t
14276  SYS_DMA_CHANNEL_HANDLE handle ) ;
14277 //******************************************************************************
14278 /*
14279  Function:
14280  void SYS_DMA_ChannelTransferEventHandlerSet
14281  (
14282  SYS_DMA_CHANNEL_HANDLE handle,
14283  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14284  const uintptr_t contextHandle
14285  )
14286  Summary:
14287  This function allows a DMA system service client to set an event handler.
14288  Description:
14289  This function allows a client to set an event handler. The client may want
14290  to receive transfer related events in cases when it uses non-blocking read and
14291  write functions. The event handler should be set before the client
14292  intends to perform operations that could generate events.
14293  This function accepts a contextHandle parameter. This parameter could be
14294  set by the client to contain (or point to) any client specific data object
14295  that should be associated with this DMA channel.
14296  Precondition:
14297  DMA should have been initialized by calling SYS_DMA_Initialize.
14298  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14299  Parameters:
14300  handle - A valid channel handle, returned from the system service's
14301  Allocate routine
14302  eventHandler - Pointer to the event handler function.
14303  contextHandle - Value identifying the context of the application/driver/middleware
14304  that registered the event handling function.
14305  Returns:
14306  None.
14307  Example:
14308  <code>
14309  // 'handle' is a valid handle returned
14310  // by the SYS_DMA_ChannelAllocate function.
14311  MY_APP_OBJ myAppObj;
14312  uint8_t buf[10];
14313  void *srcAddr;
14314  void *destAddr;
14315  size_t srcSize;
14316  size_t destSize;
14317  size_t cellSize;
14318  srcAddr = (uint8_t *) buf;
14319  srcSize = 10;
14320  destAddr = (uin8_t*) &U2TXREG;
14321  destSize = 1;
14322  cellSize = 1;
14323  channelHandle = SYS_DMA_ChannelAllocate(channel);
14324  // User registers an event handler with system service. This is done once
14325  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14326  (uintptr_t)&myAppObj);
14327  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14328  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14329  {
14330  // Error handling here
14331  }
14332  // Event Processing Technique. Event is received when
14333  // the transfer is processed.
14334  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14335  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14336  {
14337  switch(event)
14338  {
14339  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14340  // This means the data was transferred.
14341  break;
14342  case SYS_DMA_TRANSFER_EVENT_ERROR:
14343  // Error handling here.
14344  break;
14345  default:
14346  break;
14347  }
14348  }
14349  </code>
14350  Remarks:
14351  None.
14352  */
14353 
14354 void
14356  SYS_DMA_CHANNEL_HANDLE handle ,
14357  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14358  const uintptr_t contextHandle ) ;
14359 // *****************************************************************************
14360 /* Function:
14361  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14362  Summary:
14363  This function returns the error(if any) associated with the last client
14364  request.
14365  Description:
14366  This function returns the error(if any) associated with the last client
14367  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14368  the client can call this function to know the error cause.
14369  The error status will be updated on every operation and should be read
14370  frequently (ideally immediately after the service operation has completed)
14371  to know the relevant error status.
14372  Precondition:
14373  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14374  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14375  handle.
14376  Parameters:
14377  handle - Handle of the DMA channel as returned by the
14378  SYS_DMA_ChannelAllocate function.
14379  Returns:
14380  A SYS_DMA_ERROR type indicating last known error status.
14381  Example:
14382  <code>
14383  // 'handle' is a valid handle returned
14384  // by the SYS_DMA_ChannelAllocate function.
14385  // pDmaSrc, pDmaDst is the source,destination address
14386  // txferSrcSize, txferDesSize is the source,destination transfer size
14387  // cellSize is the cell size
14388  MY_APP_OBJ myAppObj;
14389  // Client registers an event handler with service. This is done once
14390  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14391  (uintptr_t)&myAppObj );
14392  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14393  DMA_TRIGGER_SOURCE_NONE);
14394  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14395  pDmaDst,txferDesSize,cellSize);
14396  SYS_DMA_ChannelForceStart(handle);
14397  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14398  {
14399  // Error handling here
14400  }
14401  // Event Processing Technique. Event is received when
14402  // the transfer is processed.
14403  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14404  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14405  {
14406  switch(event)
14407  {
14408  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14409  // This means the data was transferred.
14410  break;
14411  case SYS_DMA_TRANSFER_EVENT_ERROR:
14412  // Error handling here.
14413  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14414  {
14415  // There was an address error.
14416  // Do error handling here.
14417  }
14418  break;
14419  default:
14420  break;
14421  }
14422  }
14423  </code>
14424  Remarks:
14425  It is the client's responsibility to make sure that the error status is
14426  obtained frequently. The service will update the error status
14427  regardless of whether this has been examined by the client.
14428 */
14429 
14432  SYS_DMA_CHANNEL_HANDLE handle ) ;
14433 //******************************************************************************
14434 /* Function:
14435  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14436  Summary:
14437  Force start of transfer on the selected channel.
14438  Description:
14439  The function force start a DMA transfer to occur for the selected channel.
14440  Precondition:
14441  DMA should have been initialized by calling SYS_DMA_Initialize.
14442  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14443  The function SYS_DMA_ChannelSetup must have been called to setup and
14444  enable the required features.
14445  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14446  Parameters:
14447  handle - Handle of the DMA channel as returned by the
14448  SYS_DMA_ChannelAllocate function.
14449  Returns:
14450  None.
14451  Example:
14452  <code>
14453  // 'handle' is a valid handle returned
14454  // by the SYS_DMA_ChannelAllocate function.
14455  // pDmaSrc, pDmaDst is the source,destination address
14456  // txferSrcSize, txferDesSize is the source,destination transfer size
14457  // cellSize is the cell size
14458  MY_APP_OBJ myAppObj;
14459  // Client registers an event handler with service. This is done once
14460  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14461  (uintptr_t)&myAppObj );
14462  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14463  DMA_TRIGGER_SOURCE_NONE);
14464  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14465  pDmaDst,txferDesSize,cellSize);
14466  SYS_DMA_ChannelForceStart(handle);
14467  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14468  {
14469  // Error handling here
14470  }
14471  // Event Processing Technique. Event is received when
14472  // the transfer is processed.
14473  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14474  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14475  {
14476  switch(event)
14477  {
14478  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14479  // This means the data was transferred.
14480  break;
14481  case SYS_DMA_TRANSFER_EVENT_ERROR:
14482  // Error handling here.
14483  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14484  {
14485  // There was an address error.
14486  // Do error handling here.
14487  }
14488  break;
14489  default:
14490  break;
14491  }
14492  }
14493  </code>
14494  Remarks:
14495  This function must be used to start the DMA transfer when the channel has been
14496  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14497 */
14498 
14499 void
14501  SYS_DMA_CHANNEL_HANDLE handle ) ;
14502 //******************************************************************************
14503 /* Function:
14504  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14505  Summary:
14506  Force abort of transfer on the selected channel.
14507  Description:
14508  The function aborts a DMA transfer to occur for the selected channel.
14509  Precondition:
14510  DMA should have been initialized by calling SYS_DMA_Initialize.
14511  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14512  The function SYS_DMA_ChannelSetup must have been called to setup and
14513  enable the required features.
14514  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14515  Parameters:
14516  handle - Handle of the DMA channel as returned by the
14517  SYS_DMA_ChannelAllocate function.
14518  Returns:
14519  None.
14520  Example:
14521  <code>
14522  // 'handle' is a valid handle returned
14523  // by the SYS_DMA_ChannelAllocate function.
14524  // pDmaSrc, pDmaDst is the source,destination address
14525  // txferSrcSize, txferDesSize is the source,destination transfer size
14526  // cellSize is the cell size
14527  MY_APP_OBJ myAppObj;
14528  // Client registers an event handler with service. This is done once
14529  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14530  (uintptr_t)&myAppObj );
14531  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14532  DMA_TRIGGER_SOURCE_NONE);
14533  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14534  pDmaDst,txferDesSize,cellSize);
14535  SYS_DMA_ChannelForceStart(handle);
14536  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14537  {
14538  // Error handling here
14539  }
14540  ....
14541  ....
14542  // Client may need to abort a transfer
14543  SYS_DMA_ChannelForceAbort(handle);
14544  // Event Processing Technique. Event is received when
14545  // the transfer is processed.
14546  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14547  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14548  {
14549  switch(event)
14550  {
14551  case SYS_DMA_TRANSFER_EVENT_ABORT:
14552  // This means the data was transferred.
14553  break;
14554  case SYS_DMA_TRANSFER_EVENT_ERROR:
14555  // Error handling here.
14556  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14557  {
14558  // There was an address error.
14559  // Do error handling here.
14560  }
14561  break;
14562  default:
14563  break;
14564  }
14565  }
14566  </code>
14567  Remarks:
14568  This function must be used to abort the DMA transfer when the channel has been
14569  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14570  and SYS_DMA_ChannelAbortEventSet has not been called.
14571 */
14572 
14573 void
14575  SYS_DMA_CHANNEL_HANDLE handle ) ;
14576 //******************************************************************************
14577 /* Function:
14578  void SYS_DMA_ChannelAbortEventSet
14579  (
14580  SYS_DMA_CHANNEL_HANDLE handle,
14581  DMA_TRIGGER_SOURCE eventSrc
14582  )
14583  Summary:
14584  Sets an event source and enables cell transfer abort event for the same
14585  for the selected channel.
14586  Description:
14587  This functions enables a cell transfer abort event for the selected source
14588  event.
14589  Precondition:
14590  DMA should have been initialized by calling SYS_DMA_Initialize.
14591  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14592  The function SYS_DMA_ChannelSetup must have been called to setup and
14593  enable the required features.
14594  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14595  Parameters:
14596  handle - Handle of the DMA channel as returned by the
14597  SYS_DMA_ChannelAllocate function.
14598  eventSrc - The event causing the cell transfer abort
14599  Returns:
14600  None.
14601  Example:
14602  <code>
14603  // 'handle' is a valid handle returned
14604  // by the SYS_DMA_ChannelAllocate function.
14605  // pDmaSrc, pDmaDst is the source,destination address
14606  // txferSrcSize, txferDesSize is the source,destination transfer size
14607  // cellSize is the cell size
14608  MY_APP_OBJ myAppObj;
14609  // Client registers an event handler with service. This is done once
14610  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14611  (uintptr_t)&myAppObj );
14612  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14613  DMA_TRIGGER_SOURCE_NONE);
14614  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14615  pDmaDst,txferDesSize,cellSize);
14616  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14617  SYS_DMA_ChannelForceStart(handle);
14618  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14619  {
14620  // Error handling here
14621  }
14622  // Event Processing Technique. Event is received when
14623  // the transfer is processed.
14624  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14625  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14626  {
14627  switch(event)
14628  {
14629  case SYS_DMA_TRANSFER_EVENT_ABORT:
14630  // This means the data was transferred.
14631  break;
14632  case SYS_DMA_TRANSFER_EVENT_ERROR:
14633  // Error handling here.
14634  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14635  {
14636  // There was an address error.
14637  // Do error handling here.
14638  }
14639  break;
14640  default:
14641  break;
14642  }
14643  }
14644  </code>
14645  Remarks:
14646  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14647  current DMA transfer will be aborted. The behavior is a same as calling
14648  SYS_DMA_ChannelForceAbort.
14649 */
14650 
14651 void
14653  SYS_DMA_CHANNEL_HANDLE handle ,
14654  DMA_TRIGGER_SOURCE eventSrc ) ;
14655 //******************************************************************************
14656 /* Function:
14657  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14658  Summary:
14659  Returns the busy status of the specified DMA channel.
14660  Description:
14661  This function returns the busy status of the selected DMA channel
14662  Precondition:
14663  DMA should have been initialized by calling SYS_DMA_Initialize.
14664  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14665  Parameters:
14666  handle - Handle of the DMA channel as returned by the
14667  SYS_DMA_ChannelAllocate function.
14668  Returns:
14669  bool - true, if the selected DMA channel is active or enabled
14670  - false, if the selected DMA channel is inactive or disabled
14671  Example:
14672  <code>
14673  bool busyStat;
14674  busyStat = SYS_DMA_ChannelGetBusy(handle);
14675  </code>
14676  Remarks:
14677  This feature may not be available on all devices. Refer to the specific device
14678  data sheet to determine availability.
14679 */
14680 
14681 bool
14683  SYS_DMA_CHANNEL_HANDLE handle ) ;
14684 //******************************************************************************
14685 /* Function:
14686  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14687  Summary:
14688  Suspend DMA operation on the specified DMA channel.
14689  Description:
14690  This function suspends the DMA operation on the DMA channel
14691  specified by the channel handle.
14692  Precondition:
14693  DMA should have been initialized by calling SYS_DMA_Initialize.
14694  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14695  Parameters:
14696  handle - Handle of the DMA channel as returned by the
14697  SYS_DMA_ChannelAllocate function.
14698  Returns:
14699  None.
14700  Example:
14701  <code>
14702  SYS_DMA_ChannelSuspend(handle);
14703  </code>
14704  Remarks:
14705  This feature may not be available on all devices. Refer to the specific device
14706  data sheet to determine availability.
14707 */
14708 
14709 void
14711  SYS_DMA_CHANNEL_HANDLE handle ) ;
14712 //******************************************************************************
14713 /* Function:
14714  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14715  Summary:
14716  Resume DMA operation on the specified DMA channel.
14717  Description:
14718  This function resumes the DMA operation on the DMA channel
14719  specified by the channel handle.
14720  Precondition:
14721  DMA should have been initialized by calling SYS_DMA_Initialize.
14722  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14723  Parameters:
14724  handle - Handle of the DMA channel as returned by the
14725  SYS_DMA_ChannelAllocate function.
14726  Returns:
14727  None.
14728  Example:
14729  <code>
14730  SYS_DMA_ChannelResume(handle);
14731  </code>
14732  Remarks:
14733  This feature may not be available on all devices. Refer to the specific device
14734  data sheet to determine availability.
14735 */
14736 
14737 void
14739  SYS_DMA_CHANNEL_HANDLE handle ) ;
14740 // *****************************************************************************
14741 // *****************************************************************************
14742 // Section: Global DMA Management Functions
14743 // *****************************************************************************
14744 // *****************************************************************************
14745 //******************************************************************************
14746 /* Function:
14747  void SYS_DMA_Suspend(void)
14748  Summary:
14749  Suspend DMA transfers.
14750  Description:
14751  This function suspends DMA transfers to allow CPU uninterrupted access
14752  to data bus
14753  Precondition:
14754  DMA should have been initialized by calling SYS_DMA_Initialize.
14755  Parameters:
14756  None.
14757  Returns:
14758  None.
14759  Example:
14760  <code>
14761  SYS_DMA_Suspend();
14762  </code>
14763  Remarks:
14764  None
14765 */
14766 
14767 void
14768  SYS_DMA_Suspend ( void ) ;
14769 //******************************************************************************
14770 /* Function:
14771  void SYS_DMA_Resume(void)
14772  Summary:
14773  Resume DMA operations.
14774  Description:
14775  This function disables DMA suspend. It resumes the DMA operation suspended
14776  by calling SYS_DMA_Suspend. The DMA operates normally.
14777  Precondition:
14778  DMA should have been initialized by calling SYS_DMA_Initialize.
14779  Parameters:
14780  None.
14781  Returns:
14782  None.
14783  Example:
14784  <code>
14785  SYS_DMA_Resume();
14786  </code>
14787  Remarks:
14788  None
14789 */
14790 
14791 void
14792  SYS_DMA_Resume ( void ) ;
14793 //******************************************************************************
14794 /* Function:
14795  bool SYS_DMA_IsBusy(void)
14796  Summary:
14797  Returns the busy status of the DMA module.
14798  Description:
14799  This function returns the busy status of the DMA module
14800  Precondition:
14801  DMA should have been initialized by calling SYS_DMA_Initialize.
14802  Parameters:
14803  None.
14804  Returns:
14805  Boolean
14806  - true - The DMA module is active
14807  - false - The DMA module is inactive and disabled
14808  <code>
14809  bool busyStat;
14810  busyStat = SYS_DMA_IsBusy();
14811  </code>
14812  Remarks:
14813  This feature may not be available on all devices. Refer to the specific device
14814  data sheet to determine availability.
14815 */
14816 
14817 bool
14818  SYS_DMA_IsBusy ( void ) ;
14819 // *****************************************************************************
14820 // *****************************************************************************
14821 // Section: Deprecated functions
14822 // *****************************************************************************
14823 // *****************************************************************************
14824 //*******************************************************************************
14825 /* Function:
14826  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14827  Summary:
14828  This function is deprecated. Use SYS_DMA_Tasks function.
14829  */
14830 
14831 void
14832  SYS_DMA_Tasks (
14833  SYS_MODULE_OBJ object ,
14834  DMA_CHANNEL activeChannel ) ;
14835 //*****************************************************************************
14836 /* Function:
14837  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14838  Summary:
14839  This function is deprecated. Use SYS_DMA_Tasks function.
14840  */
14841 
14842 void
14844  SYS_MODULE_OBJ object ) ;
14845 //*******************************************************************************
14846 /* Function:
14847  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14848  Summary:
14849  This function is deprecated. Use SYS_DMA_Tasks function.
14850  */
14851 
14852 void
14854  SYS_MODULE_OBJ object ,
14855  DMA_CHANNEL activeChannel ) ;
14856  // #ifndef _SYS_DMA_H
14857 /*******************************************************************************
14858  End of File
14859 */
14860 
14861 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14862 /* CLOSE_FILE Include File */
14863 
14864 // DOM-IGNORE-BEGIN
14865 // DOM-IGNORE-END
14866 // *****************************************************************************
14867 // *****************************************************************************
14868 // Section: Data Types
14869 // *****************************************************************************
14870 // *****************************************************************************
14871 // *****************************************************************************
14872 /* Driver USART Module Index
14873  Summary:
14874  USART driver index definitions
14875  Description:
14876  These constants provide USART driver index definitions.
14877  Remarks:
14878  These constants should be used in place of hard-coded numeric literals.
14879  These values should be passed into the DRV_USART_Initialize and
14880  DRV_USART_Open routines to identify the driver instance in use.
14881 */
14882 #define DRV_USART_INDEX_0 0
14883 #define DRV_USART_INDEX_1 1
14884 #define DRV_USART_INDEX_2 2
14885 #define DRV_USART_INDEX_3 3
14886 #define DRV_USART_INDEX_4 4
14887 #define DRV_USART_INDEX_5 5
14888 // *****************************************************************************
14889 /* USART Driver Module Count
14890  Summary:
14891  Number of valid USART drivers
14892  Description:
14893  This constant identifies the maximum number of USART Driver instances that
14894  should be defined in the system. Defining more instances than this
14895  constant will waste RAM memory space.
14896  This constant can also be used by the system and application to identify the
14897  number of USART instances on this microcontroller.
14898  Remarks:
14899  This value is part-specific.
14900 */
14901 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14902 // *****************************************************************************
14903 /* USART Driver Write Error
14904  Summary:
14905  USART Driver Write Error.
14906  Description:
14907  This constant is returned by DRV_USART_Write() function when an error
14908  occurs.
14909  Remarks:
14910  None.
14911 */
14912 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
14913 // *****************************************************************************
14914 /* USART Driver Read Error
14915  Summary:
14916  USART Driver Read Error.
14917  Description:
14918  This constant is returned by DRV_USART_Read() function when an error
14919  occurs.
14920  Remarks:
14921  None.
14922 */
14923 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
14924 // *****************************************************************************
14925 /* USART Driver Buffer Handle
14926  Summary:
14927  Handle identifying a read or write buffer passed to the driver.
14928  Description:
14929  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
14930  or DRV_USART_BufferAddWrite functions. This handle is associated with the
14931  buffer passed into the function and it allows the application to track the
14932  completion of the data from (or into) that buffer. The buffer handle value
14933  returned from the "buffer add" function is returned back to the client
14934  by the "event handler callback" function registered with the driver.
14935  The buffer handle assigned to a client request expires when the client has
14936  been notified of the completion of the buffer transfer (after event handler
14937  function that notifies the client returns) or after the buffer has been
14938  retired by the driver if no event handler callback was set.
14939  Remarks:
14940  None
14941 */
14942 
14943 typedef
14944 uintptr_t
14946 // *****************************************************************************
14947 /* USART Driver Invalid Buffer Handle
14948  Summary:
14949  Definition of an invalid buffer handle.
14950  Description:
14951  This is the definition of an invalid buffer handle. An invalid buffer handle
14952  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
14953  functions if the buffer add request was not successful.
14954  Remarks:
14955  None
14956 */
14957 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
14958 // *****************************************************************************
14959 /* USART Modes of Operation
14960  Summary:
14961  Identifies the modes of the operation of the USART module
14962  Description:
14963  This data type identifies the modes of the operation of the USART module.
14964  Remarks:
14965  Not all modes are available on all devices. Refer to the specific device data
14966  sheet to determine availability.
14967 */
14968 
14969 typedef
14970  enum
14971  {
14972  /* USART works in IRDA mode */
14974  /* This is the normal point to point communication mode where the USART
14975  communicates directly with another USART by connecting it's Transmit signal
14976  to the external USART's Receiver signal and vice versa. An external
14977  transceiver may be connected to obtain RS-232 signal levels. This type of
14978  connection is typically full duplex. */
14980  /* This is a multi-point bus mode where the USART can communicate with
14981  many other USARTS on a bus using an address-based protocol such as RS-485.
14982  This mode is typically half duplex and the physical layer may require a
14983  transceiver. In this mode every USART on the bus is assigned an address and
14984  the number of data bits is 9 bits */
14986  /* Loopback mode internally connects the Transmit signal to the Receiver
14987  signal, looping data transmission back into this USART's own input. It is
14988  useful primarily as a test mode. */
14991 // *****************************************************************************
14992 /* USART Driver Buffer Events
14993  Summary
14994  Identifies the possible events that can result from a buffer add request.
14995  Description
14996  This enumeration identifies the possible events that can result from a
14997  buffer add request caused by the client calling either the
14998  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
14999  Remarks:
15000  One of these values is passed in the "event" parameter of the event
15001  handling callback function that the client registered with the driver by
15002  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15003  transfer request is completed.
15004 */
15005 
15006 typedef
15007  enum
15008  {
15009  /* All data from or to the buffer was transferred successfully. */
15011  /* There was an error while processing the buffer transfer request. */
15013  /* Data transfer aborted (Applicable in DMA mode) */
15016 // *****************************************************************************
15017 /* USART Driver Buffer Result
15018  Summary
15019  Identifies the possible result of the buffer processing.
15020  Description
15021  This enumeration identifies the possible result of the buffer processing.
15022 
15023  Remarks:
15024  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15025  is in the free buffer pool.
15026 */
15027 
15028 typedef
15029  enum
15030  {
15031  /* Buffer handle is not valid*/
15033  /* Buffer handle has expired. */
15035  /* Buffer is removed from the queue succesfully*/
15037  /* Buffer removal failed because of unable to acquire the mutex
15038  * This is applicable in RTOS mode only */
15041 // *****************************************************************************
15042 /* USART Driver Buffer Event Handler Function Pointer
15043  Summary
15044  Pointer to a USART Driver Buffer Event handler function
15045  Description
15046  This data type defines the required function signature for the USART driver
15047  buffer event handling callback function. A client must register a pointer
15048  to a buffer event handling function whose function signature (parameter
15049  and return value types) match the types specified by this function pointer
15050  in order to receive buffer related event calls back from the driver.
15051  The parameters and return values and are described here and
15052  a partial example implementation is provided.
15053  Parameters:
15054  event - Identifies the type of event
15055  bufferHandle - Handle identifying the buffer to which the vent relates
15056  context - Value identifying the context of the application that registered
15057  the event handling function.
15058  Returns:
15059  None.
15060  Example:
15061  <code>
15062  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15063  DRV_USART_BUFFER_HANDLE bufferHandle,
15064  uintptr_t context )
15065  {
15066  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15067  switch(event)
15068  {
15069  case DRV_USART_BUFFER_EVENT_COMPLETE:
15070  // Handle the completed buffer.
15071  break;
15072  case DRV_USART_BUFFER_EVENT_ERROR:
15073  default:
15074  // Handle error.
15075  break;
15076  }
15077  }
15078  </code>
15079  Remarks:
15080  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15081  transferred successfully.
15082  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15083  transferred successfully. The DRV_USART_ErrorGet function can be called to
15084  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15085  called to find out how many bytes were processed.
15086  The bufferHandle parameter contains the buffer handle of the buffer that
15087  associated with the event.
15088  The context parameter contains the a handle to the client context,
15089  provided at the time the event handling function was registered using the
15090  DRV_USART_BufferEventHandlerSet function. This context handle value is
15091  passed back to the client as the "context" parameter. It can be any value
15092  necessary to identify the client context or instance (such as a pointer to
15093  the client's data) instance of the client that made the buffer add request.
15094  The event handler function executes in the driver peripheral's interrupt
15095  context when the driver is configured for interrupt mode operation. It is
15096  recommended of the application to not perform process intensive or blocking
15097  operations with in this function.
15098  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15099  be called in the event handler to add a buffer to the driver queue. These
15100  functions can only be called to add buffers to the driver whose event
15101  handler is running. For example, buffers cannot be added USART2 driver in
15102  USART1 driver event handler.
15103 */
15104 
15105 typedef
15107 DRV_USART_BUFFER_HANDLE bufferHandle ,
15108 uintptr_t context ) ;
15109 // *****************************************************************************
15110 /* USART Driver Byte Event Handler Function Pointer
15111  Summary
15112  Pointer to a USART Driver Byte Event handler function
15113  Description
15114  This data type defines the required function signature for the USART driver
15115  byte event handling callback function. A client must register a pointer to a
15116  byte event handling function whose function signature (parameter and return
15117  value types) match the types specified by this function pointer in order to
15118  receive byte related event calls back from the driver.
15119  Parameters:
15120  index - Identifier for the instance
15121  Returns:
15122  None.
15123  Example:
15124  <code>
15125  void APP_MyUsartTxEventHandler(void)
15126  {
15127  // Handle the transmit byte event
15128  }
15129  </code>
15130  Remarks:
15131  The event handler function executes in the driver peripheral's interrupt
15132  context when the driver is configured for interrupt mode operation. It is
15133  recommended that the application not perform process intensive or blocking
15134  operations with in this function.
15135 */
15136 
15137 typedef
15138 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15139 // *****************************************************************************
15140 /* USART Handshake Modes
15141  Summary:
15142  Identifies the handshaking modes supported by the USART driver.
15143  Description:
15144  This data type identifies the handshaking modes supported by the USART
15145  driver.
15146  Remarks:
15147  Not all modes are available on all devices. Refer to the specific device data
15148  sheet to determine availability.
15149 */
15150 
15151 typedef
15152  enum
15153  {
15154  /* Handshaking occurs in Flow Control Mode */
15155  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15156  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15157  ,
15158  /* Handshaking occurs in Simplex Mode */
15159  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15160  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15161  ,
15162  /* No Handshaking */
15163  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15164  2 /*DOM-IGNORE-END*/
15166 // *****************************************************************************
15167 /* USART Baud Set Result
15168  Summary:
15169  Identifies the results of the baud set function.
15170  Description:
15171  This data type identifies the results of the DRV_USART_BaudSet function.
15172  Remarks:
15173  None.
15174 */
15175 
15176 typedef
15177  enum
15178  {
15179  /* The driver was not able to change the baud */
15180  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15181  - 1 /*DOM-IGNORE-END*/
15182  ,
15183  /* The driver was able to change the baud successfully */
15186 // *****************************************************************************
15187 /* USART Line Control Set Result
15188  Summary:
15189  Identifies the results of the baud set function.
15190  Description:
15191  This data type identifies the results of the DRV_USART_LineControlSet
15192  function.
15193  Remarks:
15194  None.
15195 */
15196 
15197 typedef
15198  enum
15199  {
15200  /* The driver was not able to change the Line Control */
15201  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15202  - 1 /*DOM-IGNORE-END*/
15203  ,
15204  /* The driver was able to change the Line Control successfully */
15207 // *****************************************************************************
15208 /* USART Line Control Modes
15209  Summary:
15210  Identifies the line control modes supported by the USART driver.
15211  Description:
15212  This data type identifies the line control modes supported by the USART
15213  driver. Line control modes define the number of data bits, parity mode, and
15214  the number of stop bits in a USART transmit and receive frames.
15215  Remarks:
15216  The abbreviations used in the labels for the values of this enumeration
15217  follow the format <data><parity><stop>, where:
15218  <data> is the number of data bits
15219  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15220  added to obtain an even number of bits, or "ODD" for one bit
15221  added to obtain an odd number of bits.
15222  <stop> is the number of Stop bits
15223 */
15224 
15225 typedef
15226  enum
15227  {
15228  /* 8 data bits, no parity bit, 1 stop bit */
15229  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15230  USART_8N1 /* DOM-IGNORE-END*/
15231  ,
15232  /* 9 data bits, no parity bit, 1 stop bit */
15233  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15234  USART_9N1 /* DOM-IGNORE-END*/
15235  ,
15236  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15237  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15238  USART_8E1 /* DOM-IGNORE-END*/
15239  ,
15240  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15241  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15242  USART_8E2 /* DOM-IGNORE-END*/
15243  ,
15244  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15245  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15246  USART_8O1 /* DOM-IGNORE-END*/
15247  ,
15248  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15249  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15250  USART_8O2 /* DOM-IGNORE-END*/
15251  ,
15252  /* 8 data bits, no parity bit, 2 stop bit */
15253  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15254  USART_8N2 /* DOM-IGNORE-END*/
15255  ,
15256  /* 9 data bits, no parity bit, 2 stop bit */
15257  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15258  USART_9N2 /* DOM-IGNORE-END*/
15260 // *****************************************************************************
15261 /* USART Initialization flags
15262  Summary:
15263  Flags identifying features that can be enabled when the driver is
15264  initialized.
15265  Description:
15266  This enumeration defines flags identifying features that can be enabled
15267  when the driver is initialized.
15268  Remarks:
15269  These flags can be logically ORed together. They are passed into the
15270  DRV_USART_Initialize function through the "flags" member of the
15271  DRV_USART_INIT structure.
15272 */
15273 
15274 typedef
15275  enum
15276  {
15277  /* Use this if no flags need to be set */
15278  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15279  0 /*DOM-IGNORE-END*/
15280  ,
15281  /* Flag to enable "wake on start" operation. If supported and enabled,
15282  this feature will allow the USART to wake-up the device when a
15283  Start bit is received. This option should be selected only when the
15284  device is to placed in Sleep mode. Note that enabling this bit will
15285  also cause the first received character to be lost. Refer to the specific
15286  device data sheet for more information. */
15288  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15289  ,
15290  /* Flag to enable auto baud detection. If supported and enabled, this
15291  feature will allow the USART to automatically detect the baud rate in
15292  use. */
15293  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15294  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15295  ,
15296  /* Flag to enable stop in idle. If supported and enabled , this
15297  feature will allow the USART to stop when the CPU enters Idle
15298  mode */
15300  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15302 // *****************************************************************************
15303 /* Operation Mode Initialization Data
15304  Summary:
15305  Defines the initialization data required for different operation modes of
15306  USART.
15307  Description:
15308  This data type defines the initialization data required for different
15309  operation modes of the USART.
15310  Remarks:
15311  None
15312 */
15313 
15314 typedef
15315  union
15316  {
15317  /* Initialization for Addressed mode */
15318  struct
15319  {
15320  /* Address of the device. */
15321  uint8_t address ;
15322  } AddressedModeInit ;
15324 // *****************************************************************************
15325 /* USART Driver Errors.
15326  Summary:
15327  Defines the possible errors that can occur during driver operation.
15328  Description:
15329  This data type defines the possible errors that can occur when occur during
15330  USART driver operation. These values are returned by DRV_USART_ErrorGet
15331  function.
15332  Remarks:
15333  None
15334 */
15335 
15336 typedef
15337  enum
15338  {
15339  /* There was no error */
15341  /*DOM-IGNORE-BEGIN*/
15342  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15343  ,
15344  /* This indicates that a parity error has occurred */
15346  /*DOM-IGNORE-BEGIN*/
15347  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15348  ,
15349  /* This indicates that a framing error has occurred */
15351  /*DOM-IGNORE-BEGIN*/
15352  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15353  ,
15354  /* This indicates a receiver overflow has occurred */
15356  /*DOM-IGNORE-BEGIN*/
15357  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15358  ,
15359  /* Channel address error (Applicable in DMA mode) */
15360  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15361  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15362  } DRV_USART_ERROR ;
15363 // *****************************************************************************
15364 /* USART Client-Specific Driver Status
15365  Summary:
15366  Defines the client-specific status of the USART driver.
15367  Description:
15368  This enumeration defines the client-specific status codes of the USART
15369  driver.
15370  Remarks:
15371  Returned by the DRV_USART_ClientStatus function.
15372 */
15373 
15374 typedef
15375  enum
15376  {
15377  /* An error has occurred.*/
15379  /* The driver is closed, no operations for this client are ongoing,
15380  and/or the given handle is invalid. */
15382  /* The driver is currently busy and cannot start additional operations. */
15384  /* The module is running and ready for additional operations */
15387 // *****************************************************************************
15388 /* USART Driver Transfer Flags
15389  Summary
15390  Specifies the status of the receive or transmit
15391  Description
15392  This type specifies the status of the receive or transmit operation.
15393  Remarks:
15394  More than one of these values may be OR'd together to create a complete
15395  status value. To test a value of this type, the bit of interest must be
15396  ANDed with the value and checked to see if the result is non-zero.
15397 */
15398 
15399 typedef
15400  enum
15401  {
15402  /* Indicates that at least one byte of Data has been received */
15404  /*DOM-IGNORE-BEGIN*/
15405  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15406  ,
15407  /* Indicates that the core driver receiver buffer is empty */
15409  /*DOM-IGNORE-BEGIN*/
15410  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15411  ,
15412  /* Indicates that the core driver transmitter buffer is full */
15414  /*DOM-IGNORE-BEGIN*/
15415  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15416  ,
15417  /* Indicates that the core driver transmitter buffer is empty */
15419  /*DOM-IGNORE-BEGIN*/
15420  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15422 // *****************************************************************************
15423 /* USART Driver Initialization Data
15424  Summary:
15425  Defines the data required to initialize or reinitialize the USART driver
15426  Description:
15427  This data type defines the data required to initialize or reinitialize the
15428  USART driver. If the driver is built statically, the members of this data
15429  structure are statically over-ridden by static override definitions in the
15430  system_config.h file.
15431  Remarks:
15432  None.
15433 */
15434 
15435 typedef
15436  struct
15437  {
15438  /* System module initialization data */
15439  SYS_MODULE_INIT moduleInit ;
15440  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15441  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15442  system_config.h header file. */
15443  USART_MODULE_ID usartID ;
15444  /* Identifies the Operation mode of the USART driver. For a static build of
15445  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15446  system_config.h header file. */
15448  /* Data required by the operation mode of the driver. For a static build of
15449  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15450  system_config.h header file. */
15452  /* Flags to enable specific features. Refer to the
15453  description of DRV_USART_INIT_FLAGS for more details. For a static build
15454  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15455  system_config.h header file. */
15456  DRV_USART_INIT_FLAGS flags ;
15457  /* USART module Baud Rate Generator Clock. This typically
15458  the peripheral bus clock frequency. For a static build of the driver,
15459  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15460  header file. */
15461  uint32_t brgClock ;
15462  /* The initial USART line control settings. For a static build of the driver
15463  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15464  system_config.h header file. */
15465  DRV_USART_LINE_CONTROL lineControl ;
15466  /* Baud Rate value to be used, if not using auto baud. For a static build of
15467  the driver, this is overridden by the DRV_USART_BAUD macro in the
15468  system_config.h header file. */
15469  uint32_t baud ;
15470  /* Handshaking mode. For a static build of the driver, this is overridden by
15471  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15472  DRV_USART_HANDSHAKE handshake ;
15473  /* Lines enabled for the USART operation. For a static build of the driver,
15474  this is overridden by the DRV_USART_LINES_ENABLE macro in
15475  the system_config.h header file.
15476  For PPS parts, pin selection in ports overrides this. */
15477  USART_OPERATION_MODE linesEnable ;
15478  /* Interrupt source ID for the transmitter interrupt. For a static build of
15479  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15480  macro in the system_config.h header. */
15481  INT_SOURCE interruptTransmit ;
15482  /* Interrupt source ID for the receiver interrupt. For a static build of
15483  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15484  macro in the system_config.h header. */
15485  INT_SOURCE interruptReceive ;
15486  /* Interrupt source ID for the error Interrupt. For a static build of the
15487  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15488  in the system_config.h header. */
15489  INT_SOURCE interruptError ;
15490  /* This is the receive buffer queue size. This is the maximum
15491  number of read requests that driver will queue. For a
15492  static build of the driver, this is overridden by the
15493  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15494  unsigned int queueSizeReceive ;
15495  /* This is the transmit buffer queue size. This is the maximum
15496  number of write requests that driver will queue. For a
15497  static build of the driver, this is overridden by the
15498  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15499  unsigned int queueSizeTransmit ;
15500  /* This is the USART transmit DMA channel.
15501  For a static build of the driver, this is overridden by the
15502  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15503  DMA_CHANNEL dmaChannelTransmit ;
15504  /* This is the USART receive DMA channel.
15505  For a static build of the driver, this is overridden by the
15506  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15507  DMA_CHANNEL dmaChannelReceive ;
15508  /* This is the USART transmit DMA channel interrupt.
15509  For a static build of the driver, this is overridden by the
15510  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15511  INT_SOURCE dmaInterruptTransmit ;
15512  /* This is the USART receive DMA channel interrupt.
15513  For a static build of the driver, this is overridden by the
15514  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15515  INT_SOURCE dmaInterruptReceive ;
15516  } DRV_USART_INIT ;
15517 //DOM-IGNORE-BEGIN
15518 //DOM-IGNORE-END
15519  // #ifndef _DRV_USART_DEFINITIONS_H
15520 /*******************************************************************************
15521  End of File
15522 */
15523 
15524 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15525 /* CLOSE_FILE Include File */
15526 
15527 // DOM-IGNORE-BEGIN
15528 // DOM-IGNORE-END
15529 // *****************************************************************************
15530 // *****************************************************************************
15531 // Section: USART Driver Module Interface Routines
15532 // *****************************************************************************
15533 // *****************************************************************************
15534 // *****************************************************************************
15535 /* Function:
15536  SYS_MODULE_OBJ DRV_USART_Initialize
15537  (
15538  const SYS_MODULE_INDEX index,
15539  const SYS_MODULE_INIT * const init
15540  )
15541  Summary:
15542  Initializes the USART instance for the specified driver index.
15543  <p><b>Implementation:</b> Static/Dynamic</p>
15544  Description:
15545  This routine initializes the USART driver instance for the specified driver
15546  index, making it ready for clients to open and use it. The initialization
15547  data is specified by the init parameter. The initialization may fail if the
15548  number of driver objects allocated are insufficient or if the specified
15549  driver instance is already initialized. The driver instance index is
15550  independent of the USART module ID. For example, driver instance 0 can be
15551  assigned to USART2. If the driver is built statically, then some of the
15552  initialization parameters are overridden by configuration macros. Refer to
15553  the description of the DRV_USART_INIT data structure for more details on
15554  which members on this data structure are overridden.
15555  Precondition:
15556  None.
15557  Parameters:
15558  index - Identifier for the instance to be initialized
15559  init - Pointer to a data structure containing any data necessary to
15560  initialize the driver.
15561  Returns:
15562  If successful, returns a valid handle to a driver instance object.
15563  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15564  Example:
15565  <code>
15566  // The following code snippet shows an example USART driver initialization.
15567  // The driver is initialized for normal mode and a baud of 300. The
15568  // receive queue size is set to 2 and transmit queue size is set to 3.
15569  DRV_USART_INIT usartInit;
15570  SYS_MODULE_OBJ objectHandle;
15571  usartInit.baud = 300;
15572  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15573  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15574  usartInit.usartID = USART_ID_2;
15575  usartInit.brgClock = 80000000;
15576  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15577  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15578  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15579  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15580  usartInit.queueSizeReceive = 2;
15581  usartInit.queueSizeTransmit = 3;
15582  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15583  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15584  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15585  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15586  {
15587  // Handle error
15588  }
15589  </code>
15590  Remarks:
15591  This routine must be called before any other USART routine is called.
15592  This routine should only be called once during system initialization
15593  unless DRV_USART_Deinitialize is called to deinitialize the driver
15594  instance. This routine will NEVER block for hardware access.
15595 */
15596 
15597 SYS_MODULE_OBJ
15599  const SYS_MODULE_INDEX index ,
15600  const SYS_MODULE_INIT * const init ) ;
15601 // *****************************************************************************
15602 /* Function:
15603  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15604  Summary:
15605  Deinitializes the specified instance of the USART driver module.
15606  <p><b>Implementation:</b> Static/Dynamic</p>
15607  Description:
15608  Deinitializes the specified instance of the USART driver module, disabling
15609  its operation (and any hardware). Invalidates all the internal data.
15610  Precondition:
15611  Function DRV_USART_Initialize should have been called before calling this
15612  function.
15613  Parameters:
15614  object - Driver object handle, returned from the
15615  DRV_USART_Initialize routine
15616  Returns:
15617  None.
15618  Example:
15619  <code>
15620  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15621  SYS_STATUS status;
15622  DRV_USART_Deinitialize(object);
15623  status = DRV_USART_Status(object);
15624  if (SYS_MODULE_DEINITIALIZED != status)
15625  {
15626  // Check again later if you need to know
15627  // when the driver is deinitialized.
15628  }
15629  </code>
15630  Remarks:
15631  Once the Initialize operation has been called, the Deinitialize operation
15632  must be called before the Initialize operation can be called again. This
15633  routine will NEVER block waiting for hardware.
15634 */
15635 
15636 void
15638  SYS_MODULE_OBJ object ) ;
15639 // *****************************************************************************
15640 /* Function:
15641  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15642  Summary:
15643  Gets the current status of the USART driver module.
15644  <p><b>Implementation:</b> Static/Dynamic</p>
15645  Description:
15646  This routine provides the current status of the USART driver module.
15647  Precondition:
15648  Function DRV_USART_Initialize should have been called before calling this
15649  function.
15650  Parameters:
15651  object - Driver object handle, returned from the
15652  DRV_USART_Initialize routine
15653  Returns:
15654  SYS_STATUS_READY - Indicates that the driver is busy with a
15655  previous system level operation and cannot start
15656  another
15657  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15658  deinitialized
15659  Example:
15660  <code>
15661  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15662  SYS_STATUS usartStatus;
15663  usartStatus = DRV_USART _Status(object);
15664  if (SYS_STATUS_READY == usartStatus)
15665  {
15666  // This means the driver can be opened using the
15667  // DRV_USART_Open() function.
15668  }
15669  </code>
15670  Remarks:
15671  A driver can opened only when its status is SYS_STATUS_READY.
15672 */
15673 
15674 SYS_STATUS
15676  SYS_MODULE_OBJ object ) ;
15677 // *****************************************************************************
15678 /* Function:
15679  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15680  Summary:
15681  Maintains the driver's transmit state machine and implements its ISR.
15682  <p><b>Implementation:</b> Static/Dynamic</p>
15683  Description:
15684  This routine is used to maintain the driver's internal transmit state
15685  machine and implement its transmit ISR for interrupt-driven implementations.
15686  In polling mode, this function should be called from the SYS_Tasks
15687  function. In interrupt mode, this function should be called in the transmit
15688  interrupt service routine of the USART that is associated with this USART
15689  driver hardware instance.
15690  Precondition:
15691  The DRV_USART_Initialize routine must have been called for the specified
15692  USART driver instance.
15693  Parameters:
15694  object - Object handle for the specified driver instance (returned from
15695  DRV_USART_Initialize)
15696  Returns:
15697  None.
15698  Example:
15699  <code>
15700  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15701  while (true)
15702  {
15703  DRV_USART_TasksTransmit (object);
15704  // Do other tasks
15705  }
15706  </code>
15707  Remarks:
15708  This routine is normally not called directly by an application. It is
15709  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15710  ISR.
15711  This routine may execute in an ISR context and will never block or access any
15712  resources that may cause it to block.
15713 */
15714 
15715 void
15717  SYS_MODULE_OBJ object ) ;
15718 // *****************************************************************************
15719 /* Function:
15720  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15721  Summary:
15722  Maintains the driver's receive state machine and implements its ISR.
15723  <p><b>Implementation:</b> Static/Dynamic</p>
15724  Description:
15725  This routine is used to maintain the driver's internal receive state machine
15726  and implement its receive ISR for interrupt-driven implementations. In
15727  polling mode, this function should be called from the SYS_Tasks function.
15728  In interrupt mode, this function should be called in the receive interrupt
15729  service routine of the USART that is associated with this USART driver
15730  hardware instance.
15731  Precondition:
15732  The DRV_USART_Initialize routine must have been called for the specified
15733  USART driver instance.
15734  Parameters:
15735  object - Object handle for the specified driver instance (returned from
15736  DRV_USART_Initialize)
15737  Returns:
15738  None.
15739  Example:
15740  <code>
15741  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15742  while (true)
15743  {
15744  DRV_USART_TasksReceive (object);
15745  // Do other tasks
15746  }
15747  </code>
15748  Remarks:
15749  This routine is normally not called directly by an application. It is
15750  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15751  ISR.
15752  This routine may execute in an ISR context and will never block or access any
15753  resources that may cause it to block.
15754 */
15755 
15756 void
15758  SYS_MODULE_OBJ object ) ;
15759 // *****************************************************************************
15760 /* Function:
15761  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15762  Summary:
15763  Maintains the driver's error state machine and implements its ISR.
15764  <p><b>Implementation:</b> Static/Dynamic</p>
15765  Description:
15766  This routine is used to maintain the driver's internal error state machine
15767  and implement its error ISR for interrupt-driven implementations. In
15768  polling mode, this function should be called from the SYS_Tasks function.
15769  In interrupt mode, this function should be called in the error interrupt
15770  service routine of the USART that is associated with this USART driver
15771  hardware instance.
15772  Precondition:
15773  The DRV_USART_Initialize routine must have been called for the specified
15774  USART driver instance.
15775  Parameters:
15776  object - Object handle for the specified driver instance (returned from
15777  DRV_USART_Initialize)
15778  Returns:
15779  None.
15780  Example:
15781  <code>
15782  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15783  while (true)
15784  {
15785  DRV_USART_TasksError (object);
15786  // Do other tasks
15787  }
15788  </code>
15789  Remarks:
15790  This routine is normally not called directly by an application. It is
15791  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15792  ISR.
15793  This routine may execute in an ISR context and will never block or access any
15794  resources that may cause it to block.
15795 */
15796 
15797 void
15799  SYS_MODULE_OBJ object ) ;
15800 // *****************************************************************************
15801 // *****************************************************************************
15802 // Section: USART Driver Client Routines
15803 // *****************************************************************************
15804 // *****************************************************************************
15805 // *****************************************************************************
15806 /* Function:
15807  DRV_HANDLE DRV_USART_Open
15808  (
15809  const SYS_MODULE_INDEX index,
15810  const DRV_IO_INTENT ioIntent
15811  )
15812  Summary:
15813  Opens the specified USART driver instance and returns a handle to it.
15814  <p><b>Implementation:</b> Static/Dynamic</p>
15815  Description:
15816  This routine opens the specified USART driver instance and provides a
15817  handle that must be provided to all other client-level operations to
15818  identify the caller and the instance of the driver. The ioIntent
15819  parameter defines how the client interacts with this driver instance.
15820  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15821  additionally affect the behavior of the DRV_USART_Read and
15822  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15823  then these function will not block even if the required amount of data could
15824  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15825  will block until the required amount of data is processed. If the driver is
15826  configured for polling and bare-metal operation, it will not support
15827  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15828  non-blocking.
15829  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15830  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15831  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15832  client will be able to do both, read and write.
15833  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15834  exclusive access to this client. The driver cannot be opened by any
15835  other client.
15836  Precondition:
15837  Function DRV_USART_Initialize must have been called before calling this
15838  function.
15839  Parameters:
15840  index - Identifier for the object instance to be opened
15841  intent - Zero or more of the values from the enumeration
15842  DRV_IO_INTENT "ORed" together to indicate the intended use
15843  of the driver. See function description for details.
15844  Returns:
15845  If successful, the routine returns a valid open-instance handle (a number
15846  identifying both the caller and the module instance).
15847  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15848  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15849  insufficient.
15850  - if the client is trying to open the driver but driver has been opened
15851  exclusively by another client.
15852  - if the driver hardware instance being opened is not initialized or is
15853  invalid.
15854  - if the client is trying to open the driver exclusively, but has already
15855  been opened in a non exclusive mode by another client.
15856  - if the driver is not ready to be opened, typically when the initialize
15857  routine has not completed execution.
15858  Example:
15859  <code>
15860  DRV_HANDLE handle;
15861  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15862  if (DRV_HANDLE_INVALID == handle)
15863  {
15864  // Unable to open the driver
15865  // May be the driver is not initialized or the initialization
15866  // is not complete.
15867  }
15868  </code>
15869  Remarks:
15870  The handle returned is valid until the DRV_USART_Close routine is called.
15871  This routine will NEVER block waiting for hardware.If the requested intent
15872  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15873  function is thread safe in a RTOS application.
15874 */
15875 
15876 DRV_HANDLE
15877  DRV_USART_Open (
15878  const SYS_MODULE_INDEX index ,
15879  const DRV_IO_INTENT ioIntent ) ;
15880 // *****************************************************************************
15881 /* Function:
15882  void DRV_USART_Close( DRV_Handle handle )
15883  Summary:
15884  Closes an opened-instance of the USART driver.
15885  <p><b>Implementation:</b> Static/Dynamic</p>
15886  Description:
15887  This routine closes an opened-instance of the USART driver, invalidating the
15888  handle. Any buffers in the driver queue that were submitted by this client
15889  will be removed. After calling this routine, the handle passed in "handle"
15890  must not be used with any of the remaining driver routines (with one
15891  possible exception described in the "Remarks" section). A new handle must
15892  be obtained by calling DRV_USART_Open before the caller may use the driver
15893  again
15894  Precondition:
15895  The DRV_USART_Initialize routine must have been called for the specified
15896  USART driver instance.
15897  DRV_USART_Open must have been called to obtain a valid opened device handle.
15898  Parameters:
15899  handle - A valid open-instance handle, returned from the driver's
15900  open routine
15901  Returns:
15902  None.
15903  Example:
15904  <code>
15905  DRV_HANDLE handle; // Returned from DRV_USART_Open
15906  DRV_USART_Close(handle);
15907  // After this point, the handle cannot be used with any other function
15908  // except the DRV_USART_ClientStatus function, which can be used to query
15909  // the success status of the DRV_USART_Close function.
15910  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
15911  </code>
15912  Remarks:
15913  Usually there is no need for the client to verify that the Close operation
15914  has completed. The driver will abort any ongoing operations when this
15915  routine is called. However, if it requires additional time to do so in a
15916  non-blocking environment, it will still return from the Close operation but
15917  the handle is now a zombie handle. The client can only call the
15918  DRV_USART_ClientStatus on a zombie handle to track the completion of the
15919  Close operation. The DRV_USART_ClientStatus routine will return
15920  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
15921 */
15922 
15923 void
15924  DRV_USART_Close (
15925  const DRV_HANDLE handle ) ;
15926 // *****************************************************************************
15927 /*
15928  Function:
15929  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
15930  Summary:
15931  Gets the current client-specific status the USART driver.
15932  <p><b>Implementation:</b> Static/Dynamic</p>
15933  Description:
15934  This function gets the client-specific status of the USART driver associated
15935  with the given handle. This function can be used to check the status of
15936  client after the DRV_USART_Close() function has been called.
15937  Preconditions:
15938  The DRV_USART_Initialize function must have been called.
15939  DRV_USART_Open must have been called to obtain a valid opened device
15940  handle.
15941  Parameters:
15942  handle - Handle returned from the driver's open function.
15943  Returns:
15944  A DRV_USART_CLIENT_STATUS value describing the current status of the
15945  driver.
15946  Example:
15947  <code>
15948  DRV_HANDLE handle; // Returned from DRV_USART_Open
15949  DRV_USART_CLIENT_STATUS status;
15950  status = DRV_USART_ClientStatus(handle);
15951  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
15952  {
15953  // The client had not closed.
15954  }
15955  </code>
15956  Remarks:
15957  This function will not block for hardware access and will immediately return
15958  the current status. This function is thread safe when called in a RTOS
15959  application.
15960 */
15961 
15964  DRV_HANDLE handle ) ;
15965 // *****************************************************************************
15966 // *****************************************************************************
15967 // Section: USART Driver Buffer Queuing Model Interface Routines
15968 // *****************************************************************************
15969 // *****************************************************************************
15970 // *****************************************************************************
15971 /* Function:
15972  void DRV_USART_BufferAddWrite
15973  (
15974  const DRV_HANDLE handle,
15975  DRV_USART_BUFFER_HANDLE * bufferHandle,
15976  void * buffer,
15977  size_t size
15978  );
15979  Summary:
15980  Schedule a non-blocking driver write operation.
15981  <p><b>Implementation:</b> Static/Dynamic</p>
15982  Description:
15983  This function schedules a non-blocking write operation. The function returns
15984  with a valid buffer handle in the bufferHandle argument if the write request
15985  was scheduled successfully. The function adds the request to the hardware
15986  instance transmit queue and returns immediately. While the request is in the
15987  queue, the application buffer is owned by the driver and should not be
15988  modified. On returning, the bufferHandle parameter may be
15989  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
15990  - if a buffer could not be allocated to the request
15991  - if the input buffer pointer is NULL
15992  - if the client opened the driver for read-only
15993  - if the buffer size is 0
15994  - if the transmit queue is full or the queue depth is insufficient
15995  If the requesting client registered an event callback with the driver, the
15996  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
15997  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
15998  was not processed successfully.
15999  Precondition:
16000  The DRV_USART_Initialize routine must have been called for the specified
16001  USART device instance and the DRV_USART_Status must have returned
16002  SYS_STATUS_READY.
16003  DRV_USART_Open must have been called to obtain a valid opened device handle.
16004  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16005  the DRV_USART_Open call.
16006  Parameters:
16007  handle - Handle of the communication channel as return by the
16008  DRV_USART_Open function.
16009  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16010  buffer - Data to be transmitted.
16011  size - Buffer size in bytes.
16012  Returns:
16013  The bufferHandle parameter will contain the return buffer handle. This will be
16014  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16015  Example:
16016  <code>
16017  MY_APP_OBJ myAppObj;
16018  uint8_t mybuffer[MY_BUFFER_SIZE];
16019  DRV_USART_BUFFER_HANDLE bufferHandle;
16020  // myUSARTHandle is the handle returned
16021  // by the DRV_USART_Open function.
16022  // Client registers an event handler with driver
16023  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16024  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16025  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16026  myBuffer, MY_BUFFER_SIZE);
16027  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16028  {
16029  // Error handling here
16030  }
16031  // Event is received when
16032  // the buffer is processed.
16033  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16034  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16035  {
16036  // contextHandle points to myAppObj.
16037  switch(event)
16038  {
16039  case DRV_USART_BUFFER_EVENT_COMPLETE:
16040  // This means the data was transferred.
16041  break;
16042  case DRV_USART_BUFFER_EVENT_ERROR:
16043  // Error handling here.
16044  break;
16045  default:
16046  break;
16047  }
16048  }
16049  </code>
16050  Remarks:
16051  This function is thread safe in a RTOS application. It can be called from
16052  within the USART Driver Buffer Event Handler that is registered by this
16053  client. It should not be called in the event handler associated with another
16054  USART driver instance. It should not otherwise be called directly in an ISR.
16055 */
16056 
16057 void
16059  const DRV_HANDLE handle ,
16060  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16061  void * buffer ,
16062  const size_t size ) ;
16063 // *****************************************************************************
16064 /* Function:
16065  void DRV_USART_AddressedBufferAddWrite
16066  (
16067  const DRV_HANDLE hClient,
16068  DRV_USART_BUFFER_HANDLE * bufferHandle,
16069  uint8_t address,
16070  void * source,
16071  size_t nWords
16072  );
16073  Summary:
16074  Schedule a non-blocking addressed driver write operation.
16075  <p><b>Implementation:</b> Dynamic</p>
16076  Description:
16077  This function schedules a non-blocking addressed write operation. The function returns
16078  with a valid buffer handle in the bufferHandle argument if the addressed write request
16079  was scheduled successfully. The function adds the request to the hardware
16080  instance transmit queue and returns immediately. While the request is in the
16081  queue, the application buffer is owned by the driver and should not be
16082  modified. On returning, the bufferHandle parameter may be
16083  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16084  - if a buffer could not be allocated to the request
16085  - if the input buffer pointer is NULL
16086  - if the client opened the driver for read-only
16087  - if the buffer size is 0
16088  - if the transmit queue is full or the queue depth is insufficient
16089  If the requesting client registered an event callback with the driver, the
16090  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16091  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16092  was not processed successfully.
16093  Precondition:
16094  The DRV_USART_Initialize routine must have been called for the specified
16095  USART device instance and the DRV_USART_Status must have returned
16096  SYS_STATUS_READY.
16097  DRV_USART_Open must have been called to obtain a valid opened device handle.
16098  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16099  the DRV_USART_Open call.
16100  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16101  Parameters:
16102  hClient - Handle of the communication channel as return by the
16103  DRV_USART_Open function.
16104  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16105  address - Address of the receiver client
16106  source - Data to be transmitted.
16107  size - Buffer size in 16-bit words.
16108  Returns:
16109  The bufferHandle parameter will contain the return buffer handle. This will be
16110  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16111  Example:
16112  <code>
16113  MY_APP_OBJ myAppObj;
16114  uint16_t mybuffer[MY_BUFFER_SIZE];
16115  DRV_USART_BUFFER_HANDLE bufferHandle;
16116  uint8_t clientAddress;
16117  // myUSARTHandle is the handle returned
16118  // by the DRV_USART_Open function.
16119  // Client registers an event handler with driver
16120  clientAddress = 0x60;
16121  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16122  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16123  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16124  myBuffer, MY_BUFFER_SIZE);
16125  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16126  {
16127  // Error handling here
16128  }
16129  // Event is received when
16130  // the buffer is processed.
16131  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16132  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16133  {
16134  // contextHandle points to myAppObj.
16135  switch(event)
16136  {
16137  case DRV_USART_BUFFER_EVENT_COMPLETE:
16138  // This means the data was transferred.
16139  break;
16140  case DRV_USART_BUFFER_EVENT_ERROR:
16141  // Error handling here.
16142  break;
16143  default:
16144  break;
16145  }
16146  }
16147  </code>
16148  Remarks:
16149  This function is thread safe in a RTOS application. It can be called from
16150  within the USART Driver Buffer Event Handler that is registered by this
16151  client. It should not be called in the event handler associated with another
16152  USART driver instance. It should not otherwise be called directly in an ISR.
16153  The source buffer should be a 16-bit word aligned buffer.
16154  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16155 */
16156 
16157 void
16159  const DRV_HANDLE hClient ,
16160  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16161  uint8_t address ,
16162  void * source ,
16163  size_t nWords ) ;
16164 // *****************************************************************************
16165 /* Function:
16166  void DRV_USART_BufferAddRead
16167  (
16168  const DRV_HANDLE handle,
16169  DRV_USART_BUFFER_HANDLE * bufferHandle,
16170  void * buffer,
16171  const size_t size
16172  )
16173  Summary:
16174  Schedule a non-blocking driver read operation.
16175  <p><b>Implementation:</b> Static/Dynamic</p>
16176  Description:
16177  This function schedules a non-blocking read operation. The function returns
16178  with a valid buffer handle in the bufferHandle argument if the read request
16179  was scheduled successfully. The function adds the request to the hardware
16180  instance receive queue and returns immediately. While the request is in the
16181  queue, the application buffer is owned by the driver and should not be
16182  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16183  bufferHandle argument:
16184  - if a buffer could not be allocated to the request
16185  - if the input buffer pointer is NULL
16186  - if the buffer size is 0
16187  - if the read queue size is full or queue depth is insufficient.
16188  - if the driver handle is invalid
16189  If the requesting client registered an event callback with the driver, the
16190  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16191  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16192  was not processed successfully.
16193  Precondition:
16194  The DRV_USART_Initialize routine must have been called for the specified
16195  USART device instance and the DRV_USART_Status must have returned
16196  SYS_STATUS_READY.
16197  DRV_USART_Open must have been called to obtain a valid opened device handle.
16198  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16199  the DRV_USART_Open call.
16200  Parameters:
16201  handle - Handle of the communication channel as returned by the
16202  DRV_USART_Open function.
16203  buffer - Buffer where the received data will be stored.
16204  size - Buffer size in bytes.
16205  Returns:
16206  The buffer handle is returned in the bufferHandle argument. This is
16207  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16208  Example:
16209  <code>
16210  MY_APP_OBJ myAppObj;
16211  uint8_t mybuffer[MY_BUFFER_SIZE];
16212  DRV_USART_BUFFER_HANDLE bufferHandle;
16213  // myUSARTHandle is the handle returned
16214  // by the DRV_USART_Open function.
16215  // Client registers an event handler with driver
16216  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16217  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16218  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16219  myBuffer, MY_BUFFER_SIZE);
16220  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16221  {
16222  // Error handling here
16223  }
16224  // Event is received when
16225  // the buffer is processed.
16226  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16227  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16228  {
16229  // contextHandle points to myAppObj.
16230  switch(event)
16231  {
16232  case DRV_USART_BUFFER_EVENT_COMPLETE:
16233  // This means the data was transferred.
16234  break;
16235  case DRV_USART_BUFFER_EVENT_ERROR:
16236  // Error handling here.
16237  break;
16238  default:
16239  break;
16240  }
16241  }
16242  </code>
16243  Remarks:
16244  This function is thread safe in a RTOS application. It can be called from
16245  within the USART Driver Buffer Event Handler that is registered by the
16246  client. It should not be called in the event handler associated with another
16247  USART driver instance. It should not be called directly in an ISR.
16248 */
16249 
16250 void
16252  const DRV_HANDLE handle ,
16253  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16254  void * buffer ,
16255  const size_t size ) ;
16256 // *****************************************************************************
16257 /* Function:
16258  void DRV_USART_BufferEventHandlerSet
16259  (
16260  const DRV_HANDLE handle,
16261  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16262  const uintptr_t context
16263  )
16264  Summary:
16265  Allows a client to identify a buffer event handling function for the driver
16266  to call back when queued buffer transfers have finished.
16267  <p><b>Implementation:</b> Static/Dynamic</p>
16268  Description:
16269  This function allows a client to identify a buffer event handling function
16270  for the driver to call back when queued buffer transfers have finished.
16271  When a client calls either the DRV_USART_BufferAddRead or
16272  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16273  the buffer that was added to the driver's buffer queue. The driver will
16274  pass this handle back to the client by calling "eventHandler" function when
16275  the buffer transfer has completed.
16276  The event handler should be set before the client performs any "buffer add"
16277  operations that could generate events. The event handler once set, persists
16278  until the client closes the driver or sets another event handler (which
16279  could be a "NULL" pointer to indicate no callback).
16280  Precondition:
16281  The DRV_USART_Initialize routine must have been called for the specified
16282  USART driver instance.
16283  DRV_USART_Open must have been called to obtain a valid opened device handle.
16284  Parameters:
16285  handle - A valid open-instance handle, returned from the driver's
16286  open routine
16287  eventHandler - Pointer to the event handler function.
16288  context - The value of parameter will be passed back to the client
16289  unchanged, when the eventHandler function is called. It can
16290  be used to identify any client specific data object that
16291  identifies the instance of the client module (for example,
16292  it may be a pointer to the client module's state structure).
16293  Returns:
16294  None.
16295  Example:
16296  <code>
16297  // myAppObj is an application specific state data object.
16298  MY_APP_OBJ myAppObj;
16299  uint8_t mybuffer[MY_BUFFER_SIZE];
16300  DRV_USART_BUFFER_HANDLE bufferHandle;
16301  // myUSARTHandle is the handle returned
16302  // by the DRV_USART_Open function.
16303  // Client registers an event handler with driver. This is done once
16304  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16305  (uintptr_t)&myAppObj );
16306  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16307  myBuffer, MY_BUFFER_SIZE);
16308  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16309  {
16310  // Error handling here
16311  }
16312  // Event Processing Technique. Event is received when
16313  // the buffer is processed.
16314  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16315  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16316  {
16317  // The context handle was set to an application specific
16318  // object. It is now retrievable easily in the event handler.
16319  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16320  switch(event)
16321  {
16322  case DRV_USART_BUFFER_EVENT_COMPLETE:
16323  // This means the data was transferred.
16324  break;
16325  case DRV_USART_BUFFER_EVENT_ERROR:
16326  // Error handling here.
16327  break;
16328  default:
16329  break;
16330  }
16331  }
16332  </code>
16333  Remarks:
16334  If the client does not want to be notified when the queued buffer transfer
16335  has completed, it does not need to register a callback. This function is
16336  thread safe when called in a RTOS application.
16337 */
16338 
16339 void
16341  const DRV_HANDLE handle ,
16342  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16343  const uintptr_t context ) ;
16344 // *****************************************************************************
16345 /* Function:
16346  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16347  Summary:
16348  Removes a requested buffer from the queue.
16349  <p><b>Implementation:</b> Static/Dynamic</p>
16350  Description:
16351  This function removes a specified buffer from the queue.
16352  The client can use this function to delete
16353  1. An unwated stalled buffer.
16354  2. Queued buffers on timeout.
16355  or in any other use case.
16356  Precondition:
16357  The DRV_USART_Initialize routine must have been called for the specified
16358  USART driver instance.
16359  DRV_USART_Open must have been called to obtain a valid opened device handle.
16360  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16361  must have been called and a valid buffer handle returned.
16362  Parameters:
16363  bufferhandle - Handle of the buffer to delete.
16364  Returns:
16365  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16366  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16367  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16368  queue successfully.
16369  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16370  the queue because of mutex timeout in RTOS environment.
16371  Example:
16372  <code>
16373  // myAppObj is an application specific object.
16374  MY_APP_OBJ myAppObj;
16375  uint8_t mybuffer[MY_BUFFER_SIZE];
16376  DRV_USART_BUFFER_HANDLE bufferHandle;
16377  // myUSARTHandle is the handle returned
16378  // by the DRV_USART_Open function.
16379  // Client registers an event handler with driver. This is done once
16380  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16381  (uintptr_t)&myAppObj );
16382  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16383  myBuffer, MY_BUFFER_SIZE );
16384  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16385  {
16386  // Error handling here
16387  }
16388  // Event Processing Technique. Event is received when
16389  // the buffer is processed.
16390  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16391  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16392  {
16393  switch(event)
16394  {
16395  case DRV_USART_BUFFER_EVENT_COMPLETE:
16396  // This means the data was transferred.
16397  break;
16398  case DRV_USART_BUFFER_EVENT_ERROR:
16399  // Error handling here.
16400  break;
16401  default:
16402  break;
16403  }
16404  }
16405  // Timeout function, where remove queued buffer if it still exists.
16406  void APP_TimeOut(void)
16407  {
16408  DRV_USART_BUFFER_RESULT bufferResult;
16409  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16410  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16411  {
16412  //Buffer removed succesfully from the queue
16413  }
16414  else
16415  {
16416  //Either buffer is invalid or expired.
16417  //Or not able to acquire mutex in RTOS mode.
16418  }
16419  }
16420  </code>
16421  Remarks:
16422  This function is thread safe when used in a RTOS application.
16423 */
16424 
16427  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16428 // *****************************************************************************
16429 /* Function:
16430  size_t DRV_USART_BufferCompletedBytesGet
16431  (
16432  DRV_USART_BUFFER_HANDLE bufferHandle
16433  );
16434  Summary:
16435  Returns the number of bytes that have been processed for the
16436  specified buffer.
16437  <p><b>Implementation:</b> Static/Dynamic</p>
16438  Description:
16439  This function returns number of bytes that have been processed for the
16440  specified buffer. The client can use this function, in a case where the
16441  buffer has terminated due to an error, to obtain the number of bytes that
16442  have been processed. Or in any other use case.
16443  This function can be used for non-DMA buffer transfers only. It cannot be
16444  used when the USART driver is configured to use DMA.
16445  Precondition:
16446  The DRV_USART_Initialize routine must have been called for the specified
16447  USART driver instance.
16448  DRV_USART_Open must have been called to obtain a valid opened device handle.
16449  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16450  must have been called and a valid buffer handle returned.
16451  Parameters:
16452  bufferhandle - Handle for the buffer of which the processed number of bytes
16453  to be obtained.
16454  Returns:
16455  Returns the number of bytes that have been processed for this buffer.
16456  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16457  buffer handle.
16458  Example:
16459  <code>
16460  // myAppObj is an application specific object.
16461  MY_APP_OBJ myAppObj;
16462  uint8_t mybuffer[MY_BUFFER_SIZE];
16463  DRV_USART_BUFFER_HANDLE bufferHandle;
16464  // myUSARTHandle is the handle returned
16465  // by the DRV_USART_Open function.
16466  // Client registers an event handler with driver. This is done once
16467  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16468  (uintptr_t)&myAppObj );
16469  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16470  myBuffer, MY_BUFFER_SIZE );
16471  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16472  {
16473  // Error handling here
16474  }
16475  // Event Processing Technique. Event is received when
16476  // the buffer is processed.
16477  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16478  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16479  {
16480  // The context handle was set to an application specific
16481  // object. It is now retrievable easily in the event handler.
16482  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16483  size_t processedBytes;
16484  switch(event)
16485  {
16486  case DRV_USART_BUFFER_EVENT_COMPLETE:
16487  // This means the data was transferred.
16488  break;
16489  case DRV_USART_BUFFER_EVENT_ERROR:
16490  // Error handling here.
16491  // We can find out how many bytes were processed in this
16492  // buffer before the error occurred.
16493  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16494  break;
16495  default:
16496  break;
16497  }
16498  }
16499  </code>
16500  Remarks:
16501  This function is thread safe when used in a RTOS application.
16502 */
16503 
16504 size_t
16506  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16507 // *****************************************************************************
16508 /* Function:
16509  size_t DRV_USART_BufferProcessedSizeGet
16510  (
16511  DRV_USART_BUFFER_HANDLE bufferHandle
16512  );
16513  Summary:
16514  This API will be deprecated and not recommended to use.
16515  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16516  processed for the specified buffer.
16517  Description:
16518  None.
16519  Precondition:
16520  None.
16521  Parameters:
16522  None.
16523  Returns:
16524  None.
16525  Example:
16526  None.
16527  Remarks:
16528  None.
16529 */
16530 
16531 size_t
16533  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16534 // *****************************************************************************
16535 // *****************************************************************************
16536 // Section: USART Driver File System Model Routines
16537 // *****************************************************************************
16538 // *****************************************************************************
16539 // *****************************************************************************
16540 /* Function:
16541  size_t DRV_USART_Read
16542  (
16543  const DRV_HANDLE handle,
16544  void * buffer,
16545  const size_t numbytes
16546  )
16547  Summary:
16548  Reads data from the USART.
16549  <p><b>Implementation:</b> Static/Dynamic</p>
16550  Description:
16551  This routine reads data from the USART. This function is blocking if the
16552  driver was opened by the client for blocking operation. This function will
16553  not block if the driver was opened by the client for non blocking operation.
16554  If the ioIntent parameter at the time of opening the driver was
16555  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16556  until) numbytes of bytes have been received or if an error occurred. If there
16557  are buffers queued for receiving data, these buffers will be serviced first. The
16558  function will not return until the requested number of bytes have been read.
16559  If the ioIntent parameter at the time of opening the driver was
16560  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16561  bytes that were actually read. The function will not wait until numBytes of
16562  bytes have been read. If there are buffer queued for reading data, then the
16563  function will not block and will return immediately with 0 bytes read.
16564  Precondition:
16565  The DRV_USART_Initialize routine must have been called for the specified
16566  USART driver instance.
16567  DRV_USART_Open must have been called to obtain a valid opened device handle.
16568  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16569  the DRV_USART_Open call.
16570  Parameters:
16571  handle - A valid open-instance handle, returned from the driver's
16572  open routine
16573  buffer - Buffer into which the data read from the USART instance
16574  will be placed.
16575  numbytes - Total number of bytes that need to be read from the module
16576  instance (must be equal to or less than the size of the
16577  buffer)
16578  Returns:
16579  Number of bytes actually copied into the caller's buffer. Returns
16580  DRV_USART_READ_ERROR in case of an error.
16581  Example:
16582  <code>
16583  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16584  char myBuffer[MY_BUFFER_SIZE];
16585  unsigned int count;
16586  unsigned int total;
16587  total = 0;
16588  do
16589  {
16590  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16591  if(count == DRV_USART_READ_ERROR)
16592  {
16593  // There was an error. The DRV_USART_ErrorGet() function
16594  // can be called to find the exact error.
16595  }
16596  total += count;
16597  // Do something else...
16598  } while( total < MY_BUFFER_SIZE );
16599  </code>
16600  Remarks:
16601  This function is thread safe in a RTOS application. If the driver is
16602  configured for polled operation, this it will not support blocking operation
16603  in a bare metal (non-RTOS) application.
16604 */
16605 
16606 size_t
16607  DRV_USART_Read (
16608  const DRV_HANDLE handle ,
16609  void * buffer ,
16610  const size_t numbytes ) ;
16611 // *****************************************************************************
16612 /* Function:
16613  size_t DRV_USART_Write
16614  (
16615  const DRV_HANDLE handle,
16616  void * buffer,
16617  const size_t numbytes
16618  )
16619  Summary:
16620  Writes data to the USART.
16621  <p><b>Implementation:</b> Static/Dynamic</p>
16622  Description:
16623  This routine writes data to the USART. This function is blocking if the
16624  driver was opened by the client for blocking operation. This function will
16625  not block if the driver was opened by the client for non blocking operation.
16626  If the ioIntent parameter at the time of opening the driver was
16627  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16628  until) numbytes of bytes have been transmitted or if an error occurred. If
16629  there are buffers queued for writing, the function will wait until all the
16630  preceding buffers are completed. Ongoing buffer transmit operations will not
16631  be affected.
16632  If the ioIntent parameter at the time of opening the driver was
16633  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16634  bytes that were actually accepted for transmission. The function will not
16635  wait until numBytes of bytes have been transmitted. If there a buffers queued
16636  for transmit, the function will not wait and will return immediately with 0
16637  bytes.
16638  Precondition:
16639  The DRV_USART_Initialize routine must have been called for the specified
16640  USART driver instance.
16641  DRV_USART_Open must have been called to obtain a valid opened device handle.
16642  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16643  the DRV_USART_Open call.
16644  Parameters:
16645  handle - A valid open-instance handle, returned from the driver's
16646  open routine
16647  buffer - Buffer containing the data to written.
16648  numbytes - size of the buffer
16649  Returns:
16650  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16651  in case of an error.
16652  Example:
16653  <code>
16654  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16655  char myBuffer[MY_BUFFER_SIZE];
16656  int count;
16657  unsigned int total;
16658  total = 0;
16659  do
16660  {
16661  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16662  MY_BUFFER_SIZE - total);
16663  total += count;
16664  // Do something else...
16665  } while( total < MY_BUFFER_SIZE );
16666  </code>
16667  Remarks:
16668  This function is thread safe in a RTOS application. This function is thread
16669  safe in a RTOS application. If the driver is configured for polled
16670  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16671  application.
16672 */
16673 
16674 size_t
16675  DRV_USART_Write (
16676  const DRV_HANDLE handle ,
16677  void * buffer ,
16678  const size_t numbytes ) ;
16679 // *****************************************************************************
16680 /* Function:
16681  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16682  Summary:
16683  Returns the transmitter and receiver transfer status.
16684  <p><b>Implementation:</b> Static/Dynamic</p>
16685  Description:
16686  This returns the transmitter and receiver transfer status.
16687  Precondition:
16688  The DRV_USART_Initialize routine must have been called for the specified
16689  USART driver instance.
16690  DRV_USART_Open must have been called to obtain a valid opened device handle.
16691  Parameters:
16692  handle - A valid open-instance handle, returned from the driver's
16693  open routine
16694  Returns:
16695  A DRV_USART_TRANSFER_STATUS value describing the current status
16696  of the transfer.
16697  Example:
16698  <code>
16699  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16700  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16701  {
16702  // Data has been received that can be read
16703  }
16704  </code>
16705  Remarks:
16706  The returned status may contain a value with more than one of the bits
16707  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16708  should perform an "AND" with the bit of interest and verify if the result is
16709  non-zero (as shown in the example) to verify the desired status bit. This
16710  function is thread safe when called in a RTOS application.
16711 */
16712 
16715  const DRV_HANDLE handle ) ;
16716 // *****************************************************************************
16717 // *****************************************************************************
16718 // Section: USART Driver Byte Model Routines
16719 // *****************************************************************************
16720 // *****************************************************************************
16721 // *****************************************************************************
16722 /* Function:
16723  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16724  Summary:
16725  Reads a byte of data from the USART.
16726  <p><b>Implementation:</b> Static/Dynamic</p>
16727  Description:
16728  This routine reads a byte of data from the USART.
16729  Precondition:
16730  The DRV_USART_Initialize routine must have been called for the specified
16731  USART driver instance.
16732  DRV_USART_Open must have been called to obtain a valid opened device handle.
16733  The transfer status should be checked to see if the receiver is not empty
16734  before calling this function.
16735  Parameters:
16736  handle - A valid open-instance handle, returned from the driver's
16737  open routine
16738  Returns:
16739  A data byte received by the driver.
16740  Example:
16741  <code>
16742  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16743  char myBuffer[MY_BUFFER_SIZE];
16744  unsigned int numBytes;
16745  numBytes = 0;
16746  do
16747  {
16748  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16749  {
16750  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16751  }
16752  // Do something else...
16753  } while( numBytes < MY_BUFFER_SIZE);
16754  </code>
16755  Remarks:
16756  This function is thread safe when called in a RTOS application. Note that
16757  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16758  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16759  DRV_USART_Write functions in a application. Calling the
16760  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16761  processing of any queued buffers.
16762 */
16763 
16764 uint8_t
16766  const DRV_HANDLE handle ) ;
16767 // *****************************************************************************
16768 /* Function:
16769  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16770  Summary:
16771  Writes a byte of data to the USART.
16772  <p><b>Implementation:</b> Static/Dynamic</p>
16773  Description:
16774  This routine writes a byte of data to the USART.
16775  Precondition:
16776  The DRV_USART_Initialize routine must have been called for the specified
16777  USART driver instance.
16778  DRV_USART_Open must have been called to obtain a valid opened device handle.
16779  The transfer status should be checked to see if transmitter is not full
16780  before calling this function.
16781  Parameters:
16782  handle - A valid open-instance handle, returned from the driver's
16783  open routine
16784  byte - Data byte to write to the USART
16785  Returns:
16786  None.
16787  Example:
16788  <code>
16789  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16790  char myBuffer[MY_BUFFER_SIZE];
16791  unsigned int numBytes;
16792  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16793  numBytes = 0;
16794  while( numBytes < MY_BUFFER_SIZE );
16795  {
16796  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16797  {
16798  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16799  }
16800  // Do something else...
16801  }
16802  </code>
16803  Remarks:
16804  This function is thread safe when called in a RTOS application. Note that
16805  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16806  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16807  DRV_USART_Write functions in a application. Calling the
16808  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16809  processing of any queued buffers.
16810 */
16811 
16812 void
16814  const DRV_HANDLE handle ,
16815  const uint8_t byte ) ;
16816 // *****************************************************************************
16817 /* Function:
16818  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16819  Summary:
16820  Returns the size of the receive buffer.
16821  <p><b>Implementation:</b> Static/Dynamic</p>
16822  Description:
16823  This routine returns the size of the receive buffer.
16824  Precondition:
16825  The DRV_USART_Initialize routine must have been called for the specified
16826  USART driver instance.
16827  DRV_USART_Open must have been called to obtain a valid opened device handle.
16828  Parameters:
16829  handle - A valid open-instance handle, returned from the driver's
16830  open routine
16831  Returns:
16832  Size of the driver's receive buffer, in bytes.
16833  Example:
16834  <code>
16835  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16836  const uint8_t readBuffer[5];
16837  unsigned int size, numBytes = 0;
16838  unsigned int readbufferLen = sizeof(readBuffer);
16839  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16840  // Do something based on the receiver buffer size
16841  </code>
16842  Remarks:
16843  Does not account for client queued buffers. This function is thread safe
16844  when called in a RTOS application.
16845 */
16846 
16847 unsigned int
16849  const DRV_HANDLE handle ) ;
16850 // *****************************************************************************
16851 /* Function:
16852  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16853  Summary:
16854  Returns the size of the transmit buffer.
16855  <p><b>Implementation:</b> Static/Dynamic</p>
16856  Description:
16857  This routine returns the size of the transmit buffer and can be used by the
16858  application to determine the number of bytes to write with the
16859  DRV_USART_WriteByte function.
16860  Precondition:
16861  The DRV_USART_Initialize routine must have been called for the specified
16862  USART driver instance.
16863  DRV_USART_Open must have been called to obtain a valid opened device handle.
16864  Parameters:
16865  handle - A valid open-instance handle, returned from the driver's
16866  open routine
16867  Returns:
16868  Size of the driver's transmit buffer, in bytes.
16869  Examples:
16870  <code>
16871  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16872  const uint8_t writeBuffer[5];
16873  unsigned int size, numBytes = 0;
16874  unsigned int writeBufferLen = sizeof(writeBuffer);
16875  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16876  // Do something based on the transmitter buffer size
16877  </code>
16878  Remarks:
16879  Does not account for client queued buffers. This function is thread safe
16880  when used in a RTOS application.
16881 */
16882 
16883 unsigned int
16885  const DRV_HANDLE handle ) ;
16886 // *****************************************************************************
16887 /* Function:
16888  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16889  Summary:
16890  Provides the status of the driver's receive buffer.
16891  <p><b>Implementation:</b> Static/Dynamic</p>
16892  Description:
16893  This routine indicates if the driver's receiver buffer is empty. This
16894  function can be used in conjunction with the DRV_USART_Read and
16895  DRV_USART_ReadByte functions.
16896  Precondition:
16897  The DRV_USART_Initialize routine must have been called for the specified
16898  USART driver instance.
16899  DRV_USART_Open must have been called to obtain a valid opened device handle.
16900  Parameters:
16901  handle - A valid open-instance handle, returned from the driver's
16902  open routine
16903  Returns:
16904  true - if the driver's receive buffer is empty
16905  false - if the driver's receive buffer is not empty
16906  Example:
16907  <code>
16908  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16909  char myBuffer[MY_BUFFER_SIZE];
16910  unsigned int numBytes;
16911  numBytes = 0;
16912  while( numBytes < MY_BUFFER_SIZE );
16913  {
16914  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
16915  {
16916  if( numBytes < MY_BUFFER_SIZE )
16917  {
16918  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
16919  }
16920  else
16921  {
16922  break;
16923  }
16924  }
16925  // Do something else while more data is received.
16926  }
16927  </code>
16928  Remarks:
16929  Does not account for client queued buffers. This function is safe thread
16930  safe when used in a RTOS application.
16931 */
16932 
16933 bool
16935  const DRV_HANDLE handle ) ;
16936 // *****************************************************************************
16937 /* Function:
16938  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
16939  Summary:
16940  Provides the status of the driver's transmit buffer.
16941  <p><b>Implementation:</b> Static/Dynamic</p>
16942  Description:
16943  This routine identifies if the driver's transmit buffer is full or not. This
16944  function can be used in conjunction with the DRV_USART_Write and
16945  DRV_USART_WriteByte functions.
16946  Precondition:
16947  The DRV_USART_Initialize routine must have been called for the specified
16948  USART driver instance.
16949  DRV_USART_Open must have been called to obtain a valid opened device handle.
16950  Parameters:
16951  handle - A valid open-instance handle, returned from the driver's
16952  open routine
16953  Returns:
16954  true - if the transmit buffer is full
16955  false - if the transmit buffer is not full
16956  Example:
16957  <code>
16958  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16959  unsigned int numBytes;
16960  int bytesToWrite;
16961  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
16962  int writebufferLen = strlen((char *)writeBuffer);
16963  numBytes = 0;
16964  while( numBytes < writebufferLen )
16965  {
16966  if (DRV_USART_TransmitBufferisFull())
16967  {
16968  // Do something else until there is some room in the driver's Transmit buffer.
16969  }
16970  else
16971  {
16972  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
16973  }
16974  }
16975  </code>
16976  Remarks:
16977  Does not account for client queued buffers. This function is thread safe
16978  when called in a RTOS application.
16979 */
16980 
16981 bool
16983  const DRV_HANDLE handle ) ;
16984 // *****************************************************************************
16985 /* Function:
16986  void DRV_USART_ByteTransmitCallbackSet
16987  (
16988  const SYS_MODULE_INDEX index,
16989  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
16990  )
16991  Summary:
16992  Registers a callback function for byte transmit event.
16993  Description:
16994  This function allows a transmit callback function to be registered with the
16995  driver. The callback function is invoked when a byte has been transmitted
16996  using DRV_USART_WriteByte () function.
16997  The callback function should be registered with the driver prior to any
16998  writes to the driver. The callback functionality is available only in the
16999  interrupt mode of operation. The driver clears the interrupt after invoking
17000  the callback function.
17001  Precondition:
17002  The DRV_USART_Initialize routine must have been called for the specified
17003  USART driver instance.
17004  Parameters:
17005  index - Identifier for the object instance to be opened
17006  eventHandler - Pointer to the event handler function.
17007  Returns:
17008  None.
17009  Example:
17010  <code>
17011  // myAppObj is an application specific state data object.
17012  MY_APP_OBJ myAppObj;
17013  uint8_t mybuffer[MY_BUFFER_SIZE];
17014  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17015  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17016  (uintptr_t)&myAppObj );
17017  // Register an event handler with driver. This is done once
17018  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17019  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17020  // Event Processing Technique. Event is received when
17021  // the byte is transmitted.
17022  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17023  {
17024  // Byte has been transmitted. Handle the event.
17025  }
17026  </code>
17027  Remarks:
17028  None
17029 */
17030 
17031 void
17033  const SYS_MODULE_INDEX index ,
17034  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17035 // *****************************************************************************
17036 /* Function:
17037  void DRV_USART_ByteReceiveCallbackSet
17038  (
17039  const SYS_MODULE_INDEX index,
17040  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17041  )
17042  Summary:
17043  Registers receive callback function for byte receive event.
17044  Description:
17045  This function allows a receive callback function to be registered with the
17046  driver. The callback function is invoked when a byte has been received. The
17047  received byte can then be read using DRV_USART_ReadByte() function.
17048  The callback function should be registered with the driver as part of the
17049  initialization. The callback functionality is available only in the
17050  interrupt mode of operation. The driver clears the interrupt after invoking
17051  the callback function.
17052  Precondition:
17053  The DRV_USART_Initialize routine must have been called for the specified
17054  USART driver instance.
17055  Parameters:
17056  index - Identifier for the object instance to be opened
17057  eventHandler - Pointer to the event handler function.
17058  Returns:
17059  None.
17060  Example:
17061  <code>
17062  // myAppObj is an application specific state data object.
17063  MY_APP_OBJ myAppObj;
17064  uint8_t mybuffer[MY_BUFFER_SIZE];
17065  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17066  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17067  (uintptr_t)&myAppObj );
17068  // Register an event handler with driver. This is done once
17069  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17070  // Event Processing Technique. Event is received when
17071  // a byte is received.
17072  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17073  {
17074  // Byte has been Received. Handle the event.
17075  // Read byte using DRV_USART_ReadByte ()
17076  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17077  // check if the receiver buffer is empty.
17078  }
17079  </code>
17080  Remarks:
17081  None
17082 */
17083 
17084 void
17086  const SYS_MODULE_INDEX index ,
17087  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17088 // *****************************************************************************
17089 /* Function:
17090  void DRV_USART_ByteErrorCallbackSet
17091  (
17092  const SYS_MODULE_INDEX index,
17093  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17094  )
17095  Summary:
17096  Registers callback to handle for byte error events.
17097  Description:
17098  This function allows a callback function to be registered with the driver
17099  to handle the error events occurring in the transmit/receive path during
17100  byte transfers.
17101  The callback function should be registered as part of the initialization.
17102  The callback functionality is available only in the interrupt mode of
17103  operation. The driver clears the interrupt after invoking the callback
17104  function.
17105  Precondition:
17106  The DRV_USART_Initialize routine must have been called for the specified
17107  USART driver instance.
17108  Parameters:
17109  index - Identifier for the object instance to be opened
17110  eventHandler - Pointer to the event handler function.
17111  Returns:
17112  None.
17113  Example:
17114  <code>
17115  // myAppObj is an application specific state data object.
17116  MY_APP_OBJ myAppObj;
17117  uint8_t mybuffer[MY_BUFFER_SIZE];
17118  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17119  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17120  (uintptr_t)&myAppObj );
17121  // Register an event handler with driver. This is done once
17122  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17123  // Event Processing Technique.
17124  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17125  {
17126  // Error has occurred. Handle the event.
17127  }
17128  </code>
17129  Remarks:
17130  None
17131 */
17132 
17133 void
17135  const SYS_MODULE_INDEX index ,
17136  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17137 // *****************************************************************************
17138 // *****************************************************************************
17139 // Section: USART Driver Setup and Status Routines
17140 // *****************************************************************************
17141 // *****************************************************************************
17142 // *****************************************************************************
17143 /* Function:
17144  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17145  Summary:
17146  This function returns the error(if any) associated with the last client
17147  request.
17148  <p><b>Implementation:</b> Static/Dynamic</p>
17149  Description:
17150  This function returns the error(if any) associated with the last client
17151  request. DRV_USART_Read and DRV_USART_Write will update the client
17152  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17153  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17154  call this function to know the error cause. The error status will be updated
17155  on every operation and should be read frequently (ideally immediately after
17156  the driver operation has completed) to know the relevant error status.
17157  Precondition:
17158  The DRV_USART_Initialize routine must have been called for the specified
17159  USART driver instance.
17160  DRV_USART_Open must have been called to obtain a valid opened device handle.
17161  Parameters:
17162  bufferhandle - Handle of the buffer of which the processed number of bytes
17163  to be obtained.
17164  Returns:
17165  A DRV_USART_ERROR type indicating last known error status.
17166  Example:
17167  <code>
17168  // myAppObj is an application specific object.
17169  MY_APP_OBJ myAppObj;
17170  uint8_t mybuffer[MY_BUFFER_SIZE];
17171  DRV_USART_BUFFER_HANDLE bufferHandle;
17172  // myUSARTHandle is the handle returned
17173  // by the DRV_USART_Open function.
17174  // Client registers an event handler with driver. This is done once.
17175  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17176  (uintptr_t)&myAppObj );
17177  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17178  myBuffer, MY_BUFFER_SIZE );
17179  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17180  {
17181  // Error handling here
17182  }
17183  // Event Processing Technique. Event is received when
17184  // the buffer is processed.
17185  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17186  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17187  {
17188  // The context handle was set to an application specific
17189  // object. It is now retrievable easily in the event handler.
17190  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17191  size_t processedBytes;
17192  switch(event)
17193  {
17194  case DRV_USART_BUFFER_EVENT_COMPLETE:
17195  // This means the data was transferred.
17196  break;
17197  case DRV_USART_BUFFER_EVENT_ERROR:
17198  // Error handling here.
17199  // We can find out how many bytes were processed in this
17200  // buffer before the error occurred. We can also find
17201  // the error cause.
17202  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17203  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17204  {
17205  // There was an receive over flow error.
17206  // Do error handling here.
17207  }
17208  break;
17209  default:
17210  break;
17211  }
17212  }
17213  </code>
17214  Remarks:
17215  It is the client's responsibility to make sure that the error status is
17216  obtained frequently. The driver will update the client error status
17217  regardless of whether this has been examined by the client. This function
17218  is thread safe when used in a RTOS application.
17219 */
17220 
17223  const DRV_HANDLE client ) ;
17224 // *****************************************************************************
17225 /* Function:
17226  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17227  Summary:
17228  This function changes the USART module baud to the specified value.
17229  <p><b>Implementation:</b> Static/Dynamic</p>
17230  Description:
17231  This function changes the USART module baud to the specified value. Any
17232  queued buffer requests will be processed at the updated baud. The USART
17233  driver operates at the baud specified in DRV_USART_Initialize function
17234  unless the DRV_USART_BaudSet function is called to change the baud.
17235  Precondition:
17236  The DRV_USART_Initialize routine must have been called for the specified
17237  USART driver instance.
17238  DRV_USART_Open must have been called to obtain a valid opened device handle.
17239  Parameters:
17240  handle - client handle returned by DRV_USART_Open function.
17241  baud - desired baud.
17242  Returns:
17243  None.
17244  Example:
17245  <code>
17246  // myUSARTHandle is the handle returned
17247  // by the DRV_USART_Open function.
17248  DRV_USART_BaudSet(myUSARTHandle, 9600);
17249  </code>
17250  Remarks:
17251  The implementation of this function, in this release of the driver, changes
17252  the baud immediately. This may interrupt on-going data transfer. It is
17253  recommended that the driver be opened exclusively if this function is to be
17254  called. This function is thread safe when used in a RTOS application.
17255 */
17256 
17259  const DRV_HANDLE client ,
17260  uint32_t baud ) ;
17261 // *****************************************************************************
17262 /* Function:
17263  void DRV_USART_LineControlSet
17264  (
17265  DRV_HANDLE client,
17266  DRV_USART_LINE_CONTROL lineControl
17267  );
17268  Summary:
17269  This function changes the USART module line control to the specified value.
17270  <p><b>Implementation:</b> Static/Dynamic</p>
17271  Description:
17272  This function changes the USART module line control parameters to the
17273  specified value. Any queued buffer requests will be processed at the
17274  updated line control parameters. The USART driver operates at the line
17275  control parameters specified in DRV_USART_Initialize function unless the
17276  DRV_USART_LineControlSet function is called to change the line control
17277  parameters.
17278  Precondition:
17279  The DRV_USART_Initialize routine must have been called for the specified
17280  USART driver instance.
17281  DRV_USART_Open must have been called to obtain a valid opened device handle.
17282  Parameters:
17283  handle - client handle returned by DRV_USART_Open function.
17284  lineControl - line control parameters.
17285  Returns:
17286  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17287  DRV_HANDLE_INVALID if the client handle is not valid.
17288  Example:
17289  <code>
17290  // myUSARTHandle is the handle returned
17291  // by the DRV_USART_Open function.
17292  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17293  </code>
17294  Remarks:
17295  The implementation of this function, in this release of the driver, changes
17296  the line control immediately. This may interrupt on-going data transfer. It
17297  is recommended that the driver be opened exclusively if this function is to
17298  be called. This function is thread safe when called in a RTOS application.
17299 */
17300 
17303  const DRV_HANDLE client ,
17304  const DRV_USART_LINE_CONTROL lineControl ) ;
17305 //DOM-IGNORE-BEGIN
17306 //DOM-IGNORE-END
17307  // #ifndef _DRV_USART_H
17308 /*******************************************************************************
17309  End of File
17310 */
17311 
17312 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17313 /* CLOSE_FILE Include File */
17314 
17315 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17316 /*******************************************************************************
17317  USART Driver Variant Mapping
17318  Company:
17319  Microchip Technology Inc.
17320  File Name:
17321  drv_usart_variant_mapping.h
17322  Summary:
17323  USART Driver Variant Mapping
17324  Description:
17325  This file provides feature and build variant mapping macros allowing the
17326  driver to easily be built with different implementation variations based
17327  on static build-time configuration selections.
17328 *******************************************************************************/
17329 //DOM-IGNORE-BEGIN
17330 /*******************************************************************************
17331 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17332 Microchip licenses to you the right to use, modify, copy and distribute
17333 Software only when embedded on a Microchip microcontroller or digital signal
17334 controller that is integrated into your product or third party product
17335 (pursuant to the sublicense terms in the accompanying license agreement).
17336 You should refer to the license agreement accompanying this Software for
17337 additional information regarding your rights and obligations.
17338 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17339 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17340 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17341 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17342 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17343 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17344 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17345 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17346 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17347 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17348 *******************************************************************************/
17349 //DOM-IGNORE-END
17350 #ifndef _DRV_USART_FEATURE_MAPPING_H
17351 #define _DRV_USART_FEATURE_MAPPING_H
17352 // *****************************************************************************
17353 // *****************************************************************************
17354 // Section: Interrrupt Variations
17355 // *****************************************************************************
17356 // *****************************************************************************
17357 /* Mapping of the interrupt mode variations
17358 */
17359  /* Driver is configured for polled mode */
17360 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17361 #define _DRV_USART_InterruptSourceEnable( source )
17362 #define _DRV_USART_InterruptSourceDisable( source ) false
17363 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17364 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17365 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17366 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17367 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17368  /* This means the driver is being built in a baremetal application.
17369  We cannot let a client open the driver in blocking mode */
17370 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17371 // *****************************************************************************
17372 // *****************************************************************************
17373 // Section: Buffer Queue support
17374 // *****************************************************************************
17375 // *****************************************************************************
17376 /* Mapping of macros for buffer queue support
17377 */
17378  /* We dont need buffer queues or byte model support */
17379 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17380 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17381 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17382 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17383 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17384 // *****************************************************************************
17385 // *****************************************************************************
17386 // Initializtion Parameter Static Overrides
17387 // *****************************************************************************
17388 // *****************************************************************************
17389  //_DRV_USART_FEATURE_MAPPING_H
17390 /*******************************************************************************
17391  End of File
17392 */
17393 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17394 /* CLOSE_FILE Include File */
17395 
17396 #include "system/clk/sys_clk.h"
17397 #include "system/int/sys_int.h"
17398 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17399 /*******************************************************************************
17400  Debug System Services Library Header
17401  Company:
17402  Microchip Technology Inc.
17403 
17404  File Name:
17405  sys_debug.h
17406  Summary:
17407  Defines the common debug definitions and interfaces used by MPLAB Harmony
17408  libraries to report errors and debug information to the user.
17409  Description:
17410  This header file defines the common debug definitions and interface macros
17411  (summary below) and prototypes used by MPLAB Harmony libraries to report
17412  errors and debug information to the user.
17413  *******************************************************************************/
17414 //DOM-IGNORE-BEGIN
17415 /*******************************************************************************
17416 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17417 Microchip licenses to you the right to use, modify, copy and distribute
17418 Software only when embedded on a Microchip microcontroller or digital signal
17419 controller that is integrated into your product or third party product
17420 (pursuant to the sublicense terms in the accompanying license agreement).
17421 You should refer to the license agreement accompanying this Software for
17422 additional information regarding your rights and obligations.
17423 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17424 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17425 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17426 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17427 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17428 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17429 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17430 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17431 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17432 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17433  *******************************************************************************/
17434 //DOM-IGNORE-END
17435 #ifndef _SYS_DEBUG_H
17436 #define _SYS_DEBUG_H
17437 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17438  /* LDRA full path */
17439 // This should be defined in system_config.h. It is added here as a build safe-guard.
17440 #define SYS_DEBUG_BUFFER_DMA_READY
17441 // *****************************************************************************
17442 // *****************************************************************************
17443 // Section: SYS DEBUG Data Types
17444 // *****************************************************************************
17445 // *****************************************************************************
17446 // *****************************************************************************
17447 /* SYS_ERROR_LEVEL enumeration
17448  Summary:
17449  System error message priority levels.
17450  Description:
17451  This enumeration defines the supported system error message priority values.
17452  Remarks:
17453  Used by debug message macros to compare individual message priority against
17454  a global system-wide error message priority level to determine if an
17455  individual message should be displayed.
17456 */
17457 
17458 typedef
17459  enum
17460  {
17461  /* Errors that have the potential to cause a system crash. */
17463  /* Errors that have the potential to cause incorrect behavior. */
17465  /* Warnings about potentially unexpected behavior or side effects. */
17467  /* Information helpful to understanding potential errors and warnings. */
17469  /* Verbose information helpful during debugging and testing. */
17471  } SYS_ERROR_LEVEL ;
17472 // DOM-IGNORE-BEGIN
17473 // *****************************************************************************
17474 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17475  SYS_DEBUG_ErrorLevelSet functions to access this value.
17476 */
17477 
17478 extern SYS_ERROR_LEVEL
17479  gblErrLvl ;
17480 // DOM-IGNORE-END
17481 // *****************************************************************************
17482 /* SYS Debug Module Index Number
17483  Summary:
17484  Debug System Service index.
17485  Description:
17486  This constant defines a symbolic name for the debug system service index.
17487  Remarks:
17488  There can only be a single debug system service instance in the system.
17489 */
17490 #define SYS_DEBUG_INDEX_0 0
17491 // *****************************************************************************
17492 /* SYS Debug Initialize structure
17493  Summary:
17494  Defines the data required to initialize the debug system service.
17495  Description:
17496  This structure defines the data required to initialize the debug system
17497  service.
17498  Remarks:
17499  None.
17500 */
17501 
17502 typedef
17503  struct
17504  {
17505  /* System module initialization */
17506  SYS_MODULE_INIT moduleInit ;
17507  /* Initial system error level setting. */
17508  SYS_ERROR_LEVEL errorLevel ;
17509  /* Console index to receive debug messages */
17510  SYS_MODULE_INDEX consoleIndex ;
17511  } SYS_DEBUG_INIT ;
17512 // *****************************************************************************
17513 // *****************************************************************************
17514 // Section: SYS DEBUG Functions
17515 // *****************************************************************************
17516 // *****************************************************************************
17517 // *****************************************************************************
17518 /* Function:
17519  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17520  const SYS_MODULE_INIT * const init )
17521  Summary:
17522  Initializes the global error level and specific module instance.
17523  Description:
17524  This function initializes the global error level. It also initializes any
17525  internal system debug module data structures.
17526  Precondition:
17527  None.
17528  Parameters:
17529  index - Index for the instance to be initialized
17530  init - Pointer to a data structure containing any data necessary
17531  to initialize the debug service. This pointer may be null
17532  if no data is required because static overrides have
17533  been provided.
17534  Returns:
17535  If successful, returns a valid handle to an object. Otherwise, it
17536  returns SYS_MODULE_OBJ_INVALID.
17537  Example:
17538  <code>
17539  SYS_MODULE_OBJ objectHandle;
17540  SYS_DEBUG_INIT debugInit =
17541  {
17542  .moduleInit = {0},
17543  .errorLevel = SYS_ERROR_DEBUG,
17544  };
17545  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17546  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17547  {
17548  // Handle error
17549  }
17550  </code>
17551  Remarks:
17552  This routine should only be called once during system initialization. If the
17553  system was already initialized it safely returns without causing any disturbance.
17554 */
17555 
17556 SYS_MODULE_OBJ
17558  const SYS_MODULE_INDEX index ,
17559  const SYS_MODULE_INIT * const init ) ;
17560 // *****************************************************************************
17561 /* Function:
17562  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17563  const SYS_MODULE_INIT * const init )
17564  Summary:
17565  Reinitializes and refreshes the data structure for the instance of the
17566  Debug module.
17567  Description:
17568  This function reinitializes and refreshes the data structure for the instance
17569  of the Debug module using the supplied data.
17570  Precondition:
17571  The SYS_DEBUG_Initialize function should have been called before calling
17572  this function.
17573  Parameters:
17574  object - Identifies the SYS DEBUG Object returned by the Initialize
17575  interface
17576  init - Pointer to the data structure containing any data
17577  necessary to initialize the hardware
17578  Returns:
17579  None
17580  Example:
17581  <code>
17582  SYS_MODULE_OBJ objectHandle;
17583  // Populate the console initialization structure
17584  SYS_DEBUG_INIT dbgInit =
17585  {
17586  .moduleInit = {0},
17587  .errorLevel = SYS_ERROR_DEBUG,
17588  };
17589  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17590  </code>
17591  Remarks:
17592  This operation uses the same initialization data structure as the
17593  SYS_DEBUG_Initialize operation. This function can be called multiple times
17594  to reinitialize the module.
17595 */
17596 
17597 void
17599  SYS_MODULE_OBJ object ,
17600  const SYS_MODULE_INIT * const init ) ;
17601 // *****************************************************************************
17602 /* Function:
17603  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17604  Summary:
17605  Deinitializes the specific module instance of the Debug module.
17606  Description:
17607  This function deinitializes the specific module instance disabling its
17608  operation (and any hardware for driver modules). Resets all of the internal
17609  data structures and fields for the specified instance to the default settings.
17610  Precondition:
17611  The SYS_DEBUG_Initialize function should have been called before calling
17612  this function.
17613  Parameters:
17614  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17615  Returns:
17616  None.
17617  Example:
17618  <code>
17619  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17620  SYS_DEBUG_Deinitialize (object);
17621  </code>
17622  Remarks:
17623  Once the Initialize operation has been called, the Deinitialize
17624  operation must be called before the Initialize operation can be called
17625  again.
17626 */
17627 
17628 void
17630  SYS_MODULE_OBJ object ) ;
17631 // *****************************************************************************
17632 /* Function:
17633  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17634  Summary:
17635  Maintains the debug module's state machine.
17636  Description:
17637  This function is used to maintain the debug module's internal state
17638  machine and implement its ISR for interrupt-driven implementations.
17639  Precondition:
17640  The SYS_DEBUG_Initialize function must have been called for the specified
17641  CONSOLE driver instance.
17642  Parameters:
17643  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17644  Returns:
17645  None.
17646  Example:
17647  <code>
17648  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17649  while (true)
17650  {
17651  SYS_DEBUG_Tasks (object);
17652  // Do other tasks
17653  }
17654  </code>
17655  Remarks:
17656  This function is normally not called directly by an application. It is
17657  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17658  ISR.
17659 */
17660 
17661 void
17662  SYS_DEBUG_Tasks (
17663  SYS_MODULE_OBJ object ) ;
17664 // *****************************************************************************
17665 /* Function:
17666  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17667  Summary:
17668  Returns status of the specific instance of the debug service module.
17669  Description:
17670  This function returns the status of the specific debug service module
17671  instance.
17672  Precondition:
17673  The SYS_CONSOLE_Initialize function should have been called before calling
17674  this function.
17675  Parameters:
17676  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17677  Returns:
17678  * SYS_STATUS_READY - Indicates that the module is running and
17679  ready to service requests. Any value greater
17680  than SYS_STATUS_READY is also a normal
17681  running state in which the module is ready
17682  to accept new operations.
17683  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17684  previous system level operation and cannot
17685  start another.
17686  * SYS_STATUS_ERROR - Indicates that the module is in an error
17687  state. Any value less than SYS_STATUS_ERROR
17688  is also an error state.
17689  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17690  initialized or has been deinitialized.
17691  Example:
17692  <code>
17693  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17694  SYS_STATUS debugStatus;
17695  debugStatus = SYS_DEBUG_Status (object);
17696  if (SYS_STATUS_ERROR >= debugStatus)
17697  {
17698  // Handle error
17699  }
17700  </code>
17701  Remarks:
17702  None.
17703 */
17704 
17705 SYS_STATUS
17707  SYS_MODULE_OBJ object ) ;
17708 // *****************************************************************************
17709 // *****************************************************************************
17710 // Section: SYS DEBUG Console Functions
17711 // *****************************************************************************
17712 // *****************************************************************************
17713 // *****************************************************************************
17714 /* Function:
17715  SYS_DEBUG_Message( const char* message );
17716  Summary:
17717  Prints a message to the console regardless of the system error level.
17718  Description:
17719  This function prints a message to the console regardless of the system
17720  error level. It can be used as an implementation of the SYS_MESSAGE and
17721  SYS_DEBUG_MESSAGE macros.
17722  Precondition:
17723  SYS_DEBUG_Initialize must have returned a valid object handle and the
17724  SYS_DEBUG_Tasks function must be called by the system to complete the
17725  message request.
17726  Parameters:
17727  message - Pointer to a message string to be displayed.
17728  Returns:
17729  None.
17730  Example:
17731  <code>
17732  // In system_config.h:
17733 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17734 
17735  // In source (.c) files:
17736  SYS_MESSAGE("My Message\n\r");
17737  </code>
17738  Remarks:
17739  Do not call this function directly. Call the SYS_MESSAGE or
17740  SYS_DEBUG_MESSAGE macros instead.
17741 
17742  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17743  the messages and message function calls from the source code. To access
17744  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17745  override the definitions of the individual macros.
17746 */
17747 
17748 void
17750  const char * message ) ;
17751 // *****************************************************************************
17752 /* Function:
17753  SYS_DEBUG_Print( const char* format, ... )
17754  Summary:
17755  Formats and prints a message with a variable number of arguments to the
17756  console regardless of the system error level.
17757  Description:
17758  This function formats and prints a message with a variable number of
17759  arguments to the console regardless of the system error level. It can be
17760  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17761  Precondition:
17762  SYS_DEBUG_Initialize must have returned a valid object handle and the
17763  SYS_DEBUG_Tasks function must be called by the system to complete the
17764  message request.
17765  Parameters:
17766  format - Pointer to a buffer containing the format string for
17767  the message to be displayed.
17768  ... - Zero or more optional parameters to be formated as
17769  defined by the format string.
17770  Returns:
17771  None.
17772  Example:
17773  <code>
17774  // In system_config.h
17775 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17776 
17777  // In source code
17778  int result;
17779 
17780  result = SomeOperation();
17781  if (result > MAX_VALUE)
17782  {
17783  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17784  }
17785  </code>
17786  Remarks:
17787  The format string and arguments follow the printf convention.
17788 
17789  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17790  macros instead.
17791 
17792  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17793  messages and message function calls. To access and utilize the messages,
17794  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17795  individual macros.
17796 */
17797 
17798 void
17799  SYS_DEBUG_Print (
17800  const char * format ,
17801  ... ) ;
17802 // *****************************************************************************
17803 /* Function:
17804  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17805  Summary:
17806  Sets the global system error reporting level.
17807  Description:
17808  This function sets the global system error reporting level.
17809 
17810  Precondition:
17811  SYS_DEBUG_Initialize must have returned a valid object handle.
17812  Parameters:
17813  level - The desired system error level.
17814  Returns:
17815  None.
17816  Example:
17817  <code>
17818  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17819  </code>
17820  Remarks:
17821  None.
17822 */
17823 
17824 void
17826  SYS_ERROR_LEVEL level ) ;
17827 // *****************************************************************************
17828 /* Function:
17829  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17830  Summary:
17831  Returns the global system Error reporting level.
17832  Description:
17833  This function returns the global System Error reporting level.
17834 
17835  Precondition:
17836  SYS_DEBUG_Initialize must have returned a valid object handle.
17837  Parameters:
17838  None.
17839  Returns:
17840  The global System Error Level.
17841  Example:
17842  <code>
17843  SYS_ERROR_LEVEL level;
17844 
17845  level = SYS_DEBUG_ErrorLevelGet();
17846  </code>
17847  Remarks:
17848  None.
17849 */
17850 
17852  SYS_DEBUG_ErrorLevelGet ( void ) ;
17853 // *****************************************************************************
17854 // *****************************************************************************
17855 // Section: SYS DEBUG Macros
17856 // *****************************************************************************
17857 // *****************************************************************************
17858 // *****************************************************************************
17859 /* Macro:
17860  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17861  Summary:
17862  Prints a debug message if the specified level is at or below the global
17863  system error level.
17864  Description:
17865  This macro prints a debug message if the specified level is at or below the
17866  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17867  Precondition:
17868  SYS_DEBUG_Initialize must have returned a valid object handle.
17869  Parameters:
17870  level - The current error level threshold for displaying the message.
17871  message - Pointer to a buffer containing the message to be displayed.
17872  Returns:
17873  None.
17874  Example:
17875  <code>
17876  // In system_config.h
17877 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17878 
17879  // In library source (.c) code.
17880  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17881  </code>
17882  Remarks:
17883  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17884 
17885  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17886  function call from the source code. To access and utilize the message,
17887  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17888  SYS_DEBUG_MESSAGE macro.
17889 */
17890 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17891 // *****************************************************************************
17892 /* Macro:
17893  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17894  Summary:
17895  Formats and prints a debug message if the specified level is at or below the
17896  global system error level.
17897  Description:
17898  This function formats and prints a debug message if the specified level is
17899  at or below the global system error level. It can be used to implement the
17900  SYS_DEBUG_PRINT macro.
17901  Precondition:
17902  SYS_DEBUG_Initialize must have returned a valid object handle.
17903  Parameters:
17904  level - The current error level threshold for displaying the message.
17905  format - Pointer to a buffer containing the format string for
17906  the message to be displayed.
17907  ... - Zero or more optional parameters to be formated as
17908  defined by the format string.
17909  Returns:
17910  None.
17911  Example:
17912  <code>
17913  // In system_config.h
17914 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
17915 
17916  // In source code
17917  int result;
17918 
17919  result = SomeOperation();
17920  if (result > MAX_VALUE)
17921  {
17922  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
17923  // Take appropriate action
17924  }
17925  </code>
17926  Remarks:
17927  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
17928 
17929  The default SYS_DEBUG_PRINT macro definition removes the message and
17930  function call from the source code. To access and utilize the message,
17931  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17932  SYS_DEBUG_PRINT macro.
17933 */
17934 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
17935 // DOM-IGNORE-BEGIN
17936 // *****************************************************************************
17937 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
17938  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
17939  (system_config.h) will map the macros below to the appropriate system
17940  console functions.
17941 */
17942 // DOM-IGNORE-END
17943 // *****************************************************************************
17944 /* Macro:
17945  SYS_MESSAGE( const char* message )
17946  Summary:
17947  Prints a message to the console regardless of the system error level.
17948  Description:
17949  This macro is used to print a message to the console regardless of the
17950  system error level. It can be mapped to any desired implementation.
17951  Precondition:
17952  If mapped to the _SYS_MESSAGE function, then the system debug service must
17953  be initialized and running.
17954  Parameters:
17955  message - Pointer to a buffer containing the message string to be
17956  displayed.
17957  Returns:
17958  None.
17959  Example:
17960  <code>
17961  // In system_config.h:
17962 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
17963 
17964  // In source (.c) files:
17965  SYS_MESSAGE("My Message\n\r");
17966  </code>
17967  Remarks:
17968  By default, this macro is defined as nothing, effectively removing all code
17969  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
17970  defined in a way that maps calls to it to the desired implementation (see
17971  example, above).
17972 
17973  This macro can be mapped to the system console service (along with other
17974  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17975  configuration (system_config.h) instead of defining it individually.
17976 */
17977 #define SYS_MESSAGE( message )
17978 // *****************************************************************************
17979 /* Function:
17980  SYS_DEBUG_MESSAGE( const char* message )
17981  Summary:
17982  Prints a debug message if the system error level is defined defined at
17983  or lower than the level specified.
17984  Description:
17985  This function prints a debug message if the system error level is defined at
17986  or lower than the level specified.
17987  Precondition:
17988  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
17989  Parameters:
17990  level - The current error level threshold for displaying the message.
17991  message - Pointer to a buffer containing the message to be displayed.
17992  Returns:
17993  None.
17994  Example:
17995  <code>
17996 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
17997  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
17998  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
17999  </code>
18000  Remarks:
18001  By default, this macro is defined as nothing, effectively removing all code
18002  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18003  must be defined in a way that maps calls to it to the desired implementation
18004  (see example, above).
18005 
18006  This macro can be mapped to the system console service (along with other
18007  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18008  configuration (system_config.h) instead of defining it individually.
18009 */
18010 #define SYS_DEBUG_MESSAGE( level , message )
18011 // *****************************************************************************
18012 /* Function:
18013  SYS_PRINT(const char* format, ...);
18014  Summary:
18015  Formats and prints an error message with a variable number of arguments
18016  regardless of the system error level.
18017  Description:
18018  This function formats and prints an error message with a variable number of
18019  if the system error level is defined at or lower than the level specified.
18020  Precondition:
18021  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18022  Parameters:
18023  format - Pointer to a buffer containing the format string for
18024  the message to be displayed.
18025  ... - Zero or more optional parameters to be formated as
18026  defined by the format string.
18027  Returns:
18028  None.
18029  Example:
18030  <code>
18031  // In system_config.h
18032 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18033 
18034  // In source code
18035  int result;
18036 
18037  result = SomeOperation();
18038  if (result > MAX_VALUE)
18039  {
18040  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18041  // Take appropriate action
18042  }
18043  </code>
18044  Remarks:
18045  The format string and arguments follow the printf convention. This function
18046  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18047 
18048  By default, this macro is defined as nothing, effectively removing all code
18049  generated by calls to it. To process SYS_PRINT calls, this macro must be
18050  defined in a way that maps calls to it to the desired implementation (see
18051  example, above).
18052 
18053  This macro can be mapped to the system console service (along with other
18054  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18055  configuration (system_config.h) instead of defining it individually.
18056 */
18057 #define SYS_PRINT( fmt ,... )
18058 // *****************************************************************************
18059 /* Macro:
18060  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18061  Summary:
18062  Formats and prints an error message if the system error level is defined at
18063  or lower than the level specified.
18064  Description:
18065  This macro formats and prints an error message if the system error level
18066  is defined at or lower than the level specified.o
18067  Precondition:
18068  SYS_DEBUG_Initialize must have returned a valid object handle.
18069  Parameters:
18070  level - The current error level threshold for displaying the message.
18071  format - Pointer to a buffer containing the format string for
18072  the message to be displayed.
18073  ... - Zero or more optional parameters to be formated as
18074  defined by the format string.
18075  Returns:
18076  None.
18077  Example:
18078  <code>
18079  // In system_config.h
18080 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18081 
18082  // In source code
18083  int result;
18084 
18085  result = SomeOperation();
18086  if (result > MAX_VALUE)
18087  {
18088  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18089  // Take appropriate action
18090  }
18091  </code>
18092  Remarks:
18093  The format string and arguments follow the printf convention. This function
18094  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18095 
18096  By default, this macro is defined as nothing, effectively removing all code
18097  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18098  defined in a way that maps calls to it to the desired implementation (see
18099  example, above).
18100 
18101  This macro can be mapped to the system console service (along with other
18102  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18103  configuration (system_config.h) instead of defining it individually.
18104 */
18105 #define SYS_DEBUG_PRINT( level , fmt ,... )
18106 // *****************************************************************************
18107 /* Macro:
18108  SYS_DEBUG_BreakPoint( void )
18109  Summary:
18110  Inserts a software breakpoint instruction when building in Debug mode.
18111  Description:
18112  This macro inserts a software breakpoint instruction when building in Debug
18113  mode.
18114  Precondition:
18115  None.
18116  Parameters:
18117  None.
18118  Returns:
18119  None.
18120  Example:
18121  <code>
18122  if (myDebugTestFailed)
18123  {
18124  SYS_DEBUG_BreakPoint();
18125  }
18126  </code>
18127  Remarks:
18128  Compiles out if not built for debugging.
18129 */
18130 #define SYS_DEBUG_BreakPoint( )
18131 // *****************************************************************************
18132 // *****************************************************************************
18133 // Section: SYS DEBUG Deprecated Macros
18134 // *****************************************************************************
18135 // *****************************************************************************
18136 /* Do not use these macros for new development.
18137 */
18138 //DOM-IGNORE-BEGIN
18139 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18140 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18141 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18142 //DOM-IGNORE-END
18143  // _SYS_DEBUG_H
18144 /*******************************************************************************
18145  End of File
18146 */
18147 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18148 /* CLOSE_FILE Include File */
18149 
18150 // DOM-IGNORE-BEGIN
18151 // DOM-IGNORE-END
18152 // *****************************************************************************
18153 // *****************************************************************************
18154 // Section: Data Type Definitions
18155 // *****************************************************************************
18156 // *****************************************************************************
18157 /* USART FIFO+RX(8+1) size */
18158 #define _DRV_USART_RX_DEPTH 9
18159 // *****************************************************************************
18160 /* USART Static Driver Instance Object
18161  Summary:
18162  Object used to keep any data required for the static USART driver.
18163  Description:
18164  This object is used to keep track of any data that must be maintained to
18165  manage the USART static driver.
18166  Remarks:
18167  None.
18168 */
18169 
18170 typedef
18171  struct
18172  {
18173  /* Client specific error */
18174  DRV_USART_ERROR error ;
18175  } DRV_USART_OBJ ;
18176 // *****************************************************************************
18177 // *****************************************************************************
18178 // Section: Local functions.
18179 // *****************************************************************************
18180 // *****************************************************************************
18181 // DOM-IGNORE-BEGIN
18182 // DOM-IGNORE-END
18183  //#ifndef _DRV_USART_STATIC_LOCAL_H
18184 /*******************************************************************************
18185  End of File
18186 */
18187 
18188 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18189 /* CLOSE_FILE Include File */
18190 
18191 // DOM-IGNORE-BEGIN
18192 // DOM-IGNORE-END
18193 // *********************************************************************************************
18194 // *********************************************************************************************
18195 // Section: System Interface Headers for the Instance 0 of USART static driver
18196 // *********************************************************************************************
18197 // *********************************************************************************************
18198 
18199 SYS_MODULE_OBJ
18200  DRV_USART0_Initialize ( void ) ;
18201 
18202 void
18203  DRV_USART0_Deinitialize ( void ) ;
18204 
18205 SYS_STATUS
18206  DRV_USART0_Status ( void ) ;
18207 
18208 void
18209  DRV_USART0_TasksTransmit ( void ) ;
18210 
18211 void
18212  DRV_USART0_TasksReceive ( void ) ;
18213 
18214 void
18215  DRV_USART0_TasksError ( void ) ;
18216 // *********************************************************************************************
18217 // *********************************************************************************************
18218 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18219 // *********************************************************************************************
18220 // *********************************************************************************************
18221 
18222 DRV_HANDLE
18223  DRV_USART0_Open (
18224  const SYS_MODULE_INDEX index ,
18225  const DRV_IO_INTENT ioIntent ) ;
18226 
18227 void
18228  DRV_USART0_Close ( void ) ;
18229 
18231  DRV_USART0_ClientStatus ( void ) ;
18232 
18234  DRV_USART0_TransferStatus ( void ) ;
18235 
18237  DRV_USART0_ErrorGet ( void ) ;
18238 // *********************************************************************************************
18239 // *********************************************************************************************
18240 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18241 // *********************************************************************************************
18242 // *********************************************************************************************
18243 
18244 uint8_t
18245  DRV_USART0_ReadByte ( void ) ;
18246 
18247 void
18249  const uint8_t byte ) ;
18250 
18251 unsigned int
18253 
18254 unsigned int
18256 
18257 bool
18259 
18260 bool
18262 // *********************************************************************************************
18263 // *********************************************************************************************
18264 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18265 // *********************************************************************************************
18266 // *********************************************************************************************
18267 
18270  uint32_t baud ) ;
18271 
18274  DRV_USART_LINE_CONTROL lineControlMode ) ;
18275 // DOM-IGNORE-BEGIN
18276 // DOM-IGNORE-END
18277  // #ifndef _DRV_USART_STATIC_H
18278 /*******************************************************************************
18279  End of File
18280 */
18281 
18282 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18283 /* CLOSE_FILE Include File */
18284 
18285 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18286 /*******************************************************************************
18287  Ports System Service Interface Definition
18288  Company:
18289  Microchip Technology Inc.
18290  File Name:
18291  sys_ports.h
18292  Summary:
18293  Ports System Service interface definitions
18294  Description:
18295  This file contains the interface definition for the Ports system
18296  service. It provides a way to interact with the Ports subsystem to
18297  manage the timing requests supported by the system
18298 *******************************************************************************/
18299 //DOM-IGNORE-BEGIN
18300 /*******************************************************************************
18301 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18302 Microchip licenses to you the right to use, modify, copy and distribute
18303 Software only when embedded on a Microchip microcontroller or digital signal
18304 controller that is integrated into your product or third party product
18305 (pursuant to the sublicense terms in the accompanying license agreement).
18306 You should refer to the license agreement accompanying this Software for
18307 additional information regarding your rights and obligations.
18308 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18309 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18310 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18311 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18312 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18313 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18314 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18315 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18316 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18317 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18318 *******************************************************************************/
18319 //DOM-IGNORE-END
18320 #ifndef _SYS_PORTS_H
18321 #define _SYS_PORTS_H
18322 // *****************************************************************************
18323 // *****************************************************************************
18324 // Section: Included Files
18325 // *****************************************************************************
18326 // *****************************************************************************
18327 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18328 /*******************************************************************************
18329  PORTS System Service Library Interface Definition
18330  Company:
18331  Microchip Technology Inc.
18332  File Name:
18333  sys_ports_definitions.h
18334  Summary:
18335  PORTS System Service data type definitions header.
18336  Description:
18337  This file contains data type definitions header.
18338 *******************************************************************************/
18339 //DOM-IGNORE-BEGIN
18340 /*******************************************************************************
18341 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18342 Microchip licenses to you the right to use, modify, copy and distribute
18343 Software only when embedded on a Microchip microcontroller or digital signal
18344 controller that is integrated into your product or third party product
18345 (pursuant to the sublicense terms in the accompanying license agreement).
18346 You should refer to the license agreement accompanying this Software for
18347 additional information regarding your rights and obligations.
18348 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18349 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18350 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18351 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18352 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18353 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18354 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18355 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18356 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18357 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18358 *******************************************************************************/
18359 //DOM-IGNORE-END
18360 #ifndef _SYS_PORTS_DEFINITIONS_H
18361 #define _SYS_PORTS_DEFINITIONS_H
18362 // *****************************************************************************
18363 // *****************************************************************************
18364 // Section: File includes
18365 // *****************************************************************************
18366 // *****************************************************************************
18367 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18368 #include "system/common/sys_common.h"
18369 #include "system/common/sys_module.h"
18370 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18371 /*******************************************************************************
18372  Ports Peripheral Library Interface Header
18373  Company:
18374  Microchip Technology Inc.
18375  File Name:
18376  plib_ports.h
18377  Summary:
18378  Ports Peripheral Library Interface header for Ports function definitions.
18379  Description:
18380  This header file contains the function prototypes and definitions of
18381  the data types and constants that make up the interface to the Ports
18382  Peripheral Library for all families of Microchip microcontrollers. The
18383  definitions in this file are common to the Ports peripheral.
18384 *******************************************************************************/
18385 // DOM-IGNORE-BEGIN
18386 /*******************************************************************************
18387 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18388 Microchip licenses to you the right to use, modify, copy and distribute
18389 Software only when embedded on a Microchip microcontroller or digital signal
18390 controller that is integrated into your product or third party product
18391 (pursuant to the sublicense terms in the accompanying license agreement).
18392 You should refer to the license agreement accompanying this Software for
18393 additional information regarding your rights and obligations.
18394 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18395 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18396 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18397 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18398 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18399 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18400 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18401 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18402 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18403 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18404 *******************************************************************************/
18405 // DOM-IGNORE-END
18406 #ifndef _PLIB_PORTS_H
18407 #define _PLIB_PORTS_H
18408 #include <stdint.h>
18409 #include <stddef.h>
18410 // DOM-IGNORE-BEGIN
18411 // DOM-IGNORE-END
18412 // *****************************************************************************
18413 // *****************************************************************************
18414 // Section: Constants & Data Types
18415 // *****************************************************************************
18416 // *****************************************************************************
18417 // *****************************************************************************
18418 /* Ports data mask definition
18419  Summary:
18420  Data type defining the Ports data mask
18421  Description:
18422  This data type defines the Ports data mask
18423  Remarks:
18424  None.
18425 */
18426 
18427 typedef
18428 uint16_t
18430 // *****************************************************************************
18431 /* Ports data type definition
18432  Summary:
18433  Data type defining the Ports data type.
18434  Description:
18435  This data type defines the Ports data type.
18436  Remarks:
18437  None.
18438 */
18439 
18440 typedef
18441 uint32_t
18443 // *****************************************************************************
18444 // *****************************************************************************
18445 // Section: Included Files (continued at end of file)
18446 // *****************************************************************************
18447 // *****************************************************************************
18448 /* This section lists the other files that are included in this file. However,
18449  please see the end of the file for additional implementation header files
18450  that are also included.
18451 */
18452 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18453 //DOM-IGNORE-BEGIN
18454 /*******************************************************************************
18455 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18456 Microchip licenses to you the right to use, modify, copy and distribute
18457 Software only when embedded on a Microchip microcontroller or digital signal
18458 controller that is integrated into your product or third party product
18459 (pursuant to the sublicense terms in the accompanying license agreement).
18460 You should refer to the license agreement accompanying this Software for
18461 additional information regarding your rights and obligations.
18462 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18463 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18464 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18465 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18466 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18467 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18468 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18469 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18470 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18471 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18472  *******************************************************************************/
18473 //DOM-IGNORE-END
18474 #ifndef _PLIB_PORTS_PROCESSOR_H
18475 #define _PLIB_PORTS_PROCESSOR_H
18476 #error "Can't find header"
18477 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18478 /* CLOSE_FILE Include File */
18479 
18480 // *****************************************************************************
18481 // *****************************************************************************
18482 // Section: Ports Peripheral Library Interface Routines
18483 // *****************************************************************************
18484 // *****************************************************************************
18485 // *****************************************************************************
18486 /* Function:
18487  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18488  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18489  PORTS_REMAP_INPUT_PIN remapInputPin );
18490  Summary:
18491  Input function remapping.
18492  Description:
18493  This function controls the Input function remapping. It allows user to map
18494  any of the input functionality on any of the remappable input pin.
18495  This function does not perform atomic register access.
18496  Precondition:
18497  IOLOCK bit of configuration register should be clear to allow any remapping.
18498  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18499  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18500  find more information.
18501  Parameters:
18502  index - Identifier for the device instance to be configured
18503  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18504  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18505  Returns:
18506  None.
18507  Example:
18508  <code>
18509 
18510  // System Unlock
18511  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18512  // Unlock PPS registers
18513  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18514  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18515  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18516  </code>
18517  Remarks:
18518  This feature may not be available on all devices. Please refer to the
18519  specific device data sheet to determine availability or use
18520  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18521  this feature is available.
18522 */
18523 
18524 void
18526  PORTS_MODULE_ID index ,
18527  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18528  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18529 // *****************************************************************************
18530 /* Function:
18531  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18532  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18533  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18534  Summary:
18535  Output function remapping.
18536  Description:
18537  This function controls the Output function remapping. it allows user to map
18538  any of the output functionality on any of the remappable output pin.
18539  This function does not perform atomic register access.
18540  Precondition:
18541  IOLOCK bit of configuration register should be clear to allow any remapping.
18542  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18543  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18544  find more information.
18545  Parameters:
18546  index - Identifier for the device instance to be configured
18547  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18548  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18549  Returns:
18550  None.
18551  Example:
18552  <code>
18553 
18554  // System Unlock
18555  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18556  // Unlock PPS registers
18557  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18558  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18559  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18560 
18561  </code>
18562  Remarks:
18563  This feature may not be available on all devices. Please refer to the
18564  specific device data sheet to determine availability or use
18565  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18566  this feature is available.
18567 */
18568 
18569 void
18571  PORTS_MODULE_ID index ,
18572  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18573  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18574 // *****************************************************************************
18575 /* Function:
18576  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18577  PORTS_ANALOG_PIN pin,
18578  PORTS_PIN_MODE mode );
18579  Summary:
18580  Enables the selected pin as analog or digital.
18581  Description:
18582  This function enables the selected pin as analog or digital.
18583  This function does not perform atomic register access.
18584  Precondition:
18585  None.
18586  Parameters:
18587  index - Identifier for the device instance to be configured
18588  pin - Possible values of PORTS_ANALOG_PIN
18589  mode - Possible values of PORTS_PIN_MODE
18590  Returns:
18591  None.
18592  Example:
18593  <code>
18594 
18595  // Make AN0 pin as Analog
18596  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18597 
18598  </code>
18599  Remarks:
18600  This feature may not be available on all devices. Please refer to the
18601  specific device data sheet to determine availability or use
18602  PLIB_PORTS_ExistsPinMode in your application to determine whether
18603  this feature is available.
18604 */
18605 
18606 void
18608  PORTS_MODULE_ID index ,
18609  PORTS_ANALOG_PIN pin ,
18610  PORTS_PIN_MODE mode ) ;
18611 // *****************************************************************************
18612 /* Function:
18613  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18614  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18615  PORTS_PIN_MODE mode );
18616  Summary:
18617  Enables the selected port pin as analog or digital.
18618  Description:
18619  This function enables the selected port pin as analog or digital.
18620  This function does not perform atomic register access.
18621  Precondition:
18622  None.
18623  Parameters:
18624  index - Identifier for the device instance to be configured
18625  channel - Port pin channel
18626  bitPos - Position in the PORT pins
18627  mode - Possible values of PORTS_PIN_MODE
18628  Returns:
18629  None.
18630  Example:
18631  <code>
18632 
18633  // Make RC5 pin Analog
18634  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18635  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18636 
18637  </code>
18638  Remarks:
18639  This function is only available in devices with PPS. For Non-PPS devices, use the
18640  PLIB_PORTS_PinModeSelect function.
18641 
18642  This feature may not be available on all devices. Please refer to the
18643  specific device data sheet to determine availability or use
18644  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18645  this feature is available.
18646 */
18647 
18648 void
18650  PORTS_MODULE_ID index ,
18651  PORTS_CHANNEL channel ,
18652  PORTS_BIT_POS bitPos ,
18653  PORTS_PIN_MODE mode ) ;
18654 // *****************************************************************************
18655 /* Function:
18656  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18657  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18658  Summary:
18659  Enables the pull-down for selected Change Notice pins.
18660  Description:
18661  This function enables the pull-down for selected Change Notice pins.
18662  This function does not perform atomic register access.
18663  Precondition:
18664  None.
18665  Parameters:
18666  index - Identifier for the device instance to be configured
18667  channel - Port pin channel
18668  bitPos - Position in the PORT pins
18669  Returns:
18670  None.
18671  Example:
18672  <code>
18673 
18674  // Enable pull-down for RC5 pin
18675  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18676  PORTS_BIT_POS_5);
18677 
18678  </code>
18679  Remarks:
18680  This feature may not be available on all devices. Please refer to the
18681  specific device data sheet to determine availability or use
18682  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18683  determine whether this feature is available.
18684 */
18685 
18686 void
18688  PORTS_MODULE_ID index ,
18689  PORTS_CHANNEL channel ,
18690  PORTS_BIT_POS bitPos ) ;
18691 // *****************************************************************************
18692 /* Function:
18693  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18694  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18695  Summary:
18696  Disables the pull-down for selected Change Notice pins.
18697  Description:
18698  This function disables the pull-down for selected Change Notice pins.
18699  This function does not perform atomic register access.
18700  Precondition:
18701  None.
18702  Parameters:
18703  index - Identifier for the device instance to be configured
18704  channel - Port pin channel
18705  bitPos - Position in the PORT pins
18706  Returns:
18707  None.
18708  Example:
18709  <code>
18710 
18711  // Disable pull-down for RC5 pin
18712  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18713  PORTS_BIT_POS_5);
18714  </code>
18715  Remarks:
18716  This feature may not be available on all devices. Please refer to the
18717  specific device data sheet to determine availability or use
18718  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18719  determine whether this feature is available.
18720 */
18721 
18722 void
18724  PORTS_MODULE_ID index ,
18725  PORTS_CHANNEL channel ,
18726  PORTS_BIT_POS bitPos ) ;
18727 // *****************************************************************************
18728 /* Function:
18729  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18730  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18731  Summary:
18732  Enables the pull-up for selected Change Notice pins.
18733  Description:
18734  This function enables the pull-up for selected Change Notice pins.
18735  This function does not perform atomic register access.
18736  Precondition:
18737  None.
18738  Parameters:
18739  index - Identifier for the device instance to be configured
18740  channel - Port pin channel
18741  bitPos - Position in the PORT pins
18742  Returns:
18743  None.
18744  Example:
18745  <code>
18746 
18747  // Enable pull-up for RC5 pin
18748  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18749  PORTS_BIT_POS_5);
18750  </code>
18751  Remarks:
18752  This function is only available in devices with PPS. For Non-PPS devices, use the
18753  PLIB_PORTS_ChangeNoticePullUpEnable function.
18754 
18755  This feature may not be available on all devices. Please refer to the
18756  specific device data sheet to determine availability or use
18757  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18758  determine whether this feature is available.
18759 */
18760 
18761 void
18763  PORTS_MODULE_ID index ,
18764  PORTS_CHANNEL channel ,
18765  PORTS_BIT_POS bitPos ) ;
18766 // *****************************************************************************
18767 /* Function:
18768  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18769  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18770  Summary:
18771  Disables weak pull-up for the selected pin.
18772  Description:
18773  This function disables weak pull-up for the selected port pin.
18774  This function does not perform atomic register access.
18775  Precondition:
18776  None.
18777  Parameters:
18778  index - Identifier for the device instance to be configured
18779  channel - Port pin channel
18780  bitPos - Position in the PORT pins
18781  Returns:
18782  None.
18783  Example:
18784  <code>
18785 
18786  // Disable pull-up for RC5 pin
18787  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18788  PORTS_BIT_POS_5);
18789 
18790  </code>
18791  Remarks:
18792  This function is only available in devices with PPS. For Non-PPS devices, use the
18793  PLIB_PORTS_ChangeNoticePullUpDisable function.
18794 
18795  Pull-ups on change notification pins should always be disabled when the
18796  port pin is configured as a digital output.
18797 
18798  This feature may not be available on all devices. Please refer to the
18799  specific device data sheet to determine availability or use
18800  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18801  determine whether this feature is available.
18802 */
18803 
18804 void
18806  PORTS_MODULE_ID index ,
18807  PORTS_CHANNEL channel ,
18808  PORTS_BIT_POS bitPos ) ;
18809 // *****************************************************************************
18810 /* Function:
18811  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18812  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18813  Summary:
18814  Enables CN interrupt for the selected pin.
18815  Description:
18816  This function enables Change Notice interrupt for the selected port pin.
18817  This function does not perform atomic register access.
18818 
18819  Precondition:
18820  None.
18821  Parameters:
18822  index - Identifier for the device instance to be configured
18823  channel - Port pin channel
18824  bitPos - Position in the PORT pins
18825  Returns:
18826  None.
18827  Example:
18828  <code>
18829 
18830  // Enable CN interrupt for RC5 pin
18831  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18832  PORTS_BIT_POS_5);
18833 
18834  </code>
18835  Remarks:
18836  This function is only available in devices with PPS. For Non-PPS devices, use the
18837  PLIB_PORTS_PinChangeNoticeEnable function.
18838 
18839  This feature may not be available on all devices. Please refer to the
18840  specific device data sheet to determine availability or use
18841  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18842  determine whether this feature is available.
18843 */
18844 
18845 void
18847  PORTS_MODULE_ID index ,
18848  PORTS_CHANNEL channel ,
18849  PORTS_BIT_POS bitPos ) ;
18850 // *****************************************************************************
18851 /* Function:
18852  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18853  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18854  Summary:
18855  Disables CN interrupt for the selected pin.
18856  Description:
18857  This function disables Change Notice interrupt for the selected port pin.
18858  This function does not perform atomic register access.
18859  Precondition:
18860  None.
18861  Parameters:
18862  index - Identifier for the device instance to be configured
18863  channel - Port pin channel
18864  bitPos - Position in the PORT pins
18865  Returns:
18866  None.
18867  Example:
18868  <code>
18869 
18870  // Disable CN interrupt for RC5 pin
18871  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18872  PORTS_BIT_POS_5);
18873 
18874  </code>
18875  Remarks:
18876  This function is only available in devices with PPS. For Non-PPS devices, use the
18877  PLIB_PORTS_PinChangeNoticeDisable function.
18878 
18879  This feature may not be available on all devices. Please refer to the
18880  specific device data sheet to determine availability or use
18881  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18882  determine whether this feature is available.
18883 */
18884 
18885 void
18887  PORTS_MODULE_ID index ,
18888  PORTS_CHANNEL channel ,
18889  PORTS_BIT_POS bitPos ) ;
18890 // *****************************************************************************
18891 /* Function:
18892  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18893  PORTS_CHANNEL channel );
18894  Summary:
18895  Enables the change notification for selected port.
18896  Description:
18897  This function enables the change notification for selected port.
18898  This function does not perform atomic register access.
18899  Precondition:
18900  None.
18901  Parameters:
18902  index - Identifier for the device instance to be configured
18903  channel - Port pin channel
18904  Returns:
18905  None.
18906  Example:
18907  <code>
18908  // Enable Change notification for Port C
18909  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
18910 
18911  </code>
18912  Remarks:
18913  This function is only available in devices with PPS. For Non-PPS devices, use the
18914  PLIB_PORTS_ChangeNoticeEnable function.
18915 
18916  This feature may not be available on all devices. Please refer to the
18917  specific device data sheet to determine availability or use
18918  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18919  whether this feature is available.
18920 */
18921 
18922 void
18924  PORTS_MODULE_ID index ,
18925  PORTS_CHANNEL channel ) ;
18926 // *****************************************************************************
18927 /* Function:
18928  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
18929  PORTS_CHANNEL channel );
18930  Summary:
18931  Disables the change notification for selected port.
18932  Description:
18933  This function disables the change notification for selected port.
18934  This function does not perform atomic register access.
18935  Precondition:
18936  None.
18937  Parameters:
18938  index - Identifier for the device instance to be configured
18939  channel - Port pin channel
18940  Returns:
18941  None.
18942  Example:
18943  <code>
18944  // Disable Change notification for Port C
18945  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
18946 
18947  </code>
18948  Remarks:
18949  This function is only available in devices with PPS. For Non-PPS devices, use the
18950  PLIB_PORTS_ChangeNoticeDisable function.
18951 
18952  This feature may not be available on all devices. Please refer to the
18953  specific device data sheet to determine availability or use
18954  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18955  whether this feature is available.
18956 */
18957 
18958 void
18960  PORTS_MODULE_ID index ,
18961  PORTS_CHANNEL channel ) ;
18962 // *****************************************************************************
18963 /* Function:
18964  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
18965  PORTS_CHANNEL channel );
18966  Summary:
18967  Allows CN to be working in Idle mode for selected channel.
18968  Description:
18969  This function makes sure that change notification feature keeps working in
18970  Idle mode for the selected channel.
18971  This function does not perform atomic register access.
18972  Precondition:
18973  None.
18974  Parameters:
18975  index - Identifier for the device instance to be configured
18976  channel - Port pin channel
18977  Returns:
18978  None.
18979  Example:
18980  <code>
18981 
18982  // Change notification continues working in Idle mode for Port C
18983  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
18984 
18985  </code>
18986  Remarks:
18987  This function is only available in devices with PPS. For Non-PPS devices, use the
18988  PLIB_PORTS_ChangeNoticeInIdleEnable function.
18989 
18990  This feature may not be available on all devices. Please refer to the
18991  specific device data sheet to determine availability or use
18992  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
18993  whether this feature is available.
18994 */
18995 
18996 void
18998  PORTS_MODULE_ID index ,
18999  PORTS_CHANNEL channel ) ;
19000 // *****************************************************************************
19001 /* Function:
19002  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19003  PORTS_CHANNEL channel );
19004  Summary:
19005  Change Notification halts in Idle mode for selected channel.
19006  Description:
19007  This function makes sure that change notification feature halts in
19008  Idle mode for the selected channel.
19009  This function does not perform atomic register access.
19010  Precondition:
19011  None.
19012  Parameters:
19013  index - Identifier for the device instance to be configured
19014  channel - Port pin channel
19015  Returns:
19016  None.
19017  Example:
19018  <code>
19019 
19020  // Change notification halts in Idle mode for Port C
19021  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19022 
19023  </code>
19024  Remarks:
19025  This function is only available in devices with PPS. For Non-PPS devices, use the
19026  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19027 
19028  This feature may not be available on all devices. Please refer to the
19029  specific device data sheet to determine availability or use
19030  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19031  whether this feature is available.
19032 */
19033 
19034 void
19036  PORTS_MODULE_ID index ,
19037  PORTS_CHANNEL channel ) ;
19038 // *****************************************************************************
19039 /* Function:
19040  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19041  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19042  Summary:
19043  checks the status of change on the pin
19044  Description:
19045  This function checks if the change has occurred on the given pin or not.
19046  This function does not perform atomic register access.
19047  Precondition:
19048  None.
19049  Parameters:
19050  index - Identifier for the device instance to be configured
19051  channel - Port pin channel
19052  bitPos - Position in the PORT pins
19053  Returns:
19054  None.
19055  Example:
19056  <code>
19057 
19058  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19059  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19060  {
19061  //do something
19062  }
19063 
19064  </code>
19065  Remarks:
19066  This feature may not be available on all devices. Please refer to the
19067  specific device data sheet to determine availability or use
19068  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19069  whether this feature is available.
19070 */
19071 
19072 bool
19074  PORTS_MODULE_ID index ,
19075  PORTS_CHANNEL channel ,
19076  PORTS_BIT_POS bitPos ) ;
19077 // *****************************************************************************
19078 /* Function:
19079  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19080  PORTS_BIT_POS bitPos )
19081  Summary:
19082  Reads/Gets data from the selected digital pin.
19083  Description:
19084  This function reads/gets data from the selected digital PORT i/o pin.
19085  This function should be used to read the live data at the pin.
19086  This function does not perform atomic register access.
19087 
19088  Precondition:
19089  None.
19090  Parameters:
19091  index - Identifier for the device instance to be configured
19092  channel - Identifier for the Ports channel A, B, C, etc.
19093  bitPos - Possible values of PORTS_BIT_POS
19094  Returns:
19095  Port pin read data.
19096  Example:
19097  <code>
19098  // read port pin RC4
19099  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19100  PORTS_BIT_POS_4);
19101  </code>
19102  Remarks:
19103  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19104 
19105  This feature may not be available on all devices. Please refer to the
19106  specific device data sheet to determine availability or use
19107  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19108  this feature is available.
19109 */
19110 
19111 bool
19113  PORTS_MODULE_ID index ,
19114  PORTS_CHANNEL channel ,
19115  PORTS_BIT_POS bitPos ) ;
19116 // *****************************************************************************
19117 /* Function:
19118  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19119  PORTS_BIT_POS bitPos )
19120  Summary:
19121  Reads/Gets data from the selected latch.
19122  Description:
19123  This function reads/gets data from the selected PORTx Data Latch, not from
19124  the port I/O pins.
19125  This function does not perform atomic register access.
19126 
19127  Precondition:
19128  None.
19129  Parameters:
19130  index - Identifier for the device instance to be configured
19131  channel - Identifier for the Ports channel A, B, C, etc.
19132  bitPos - Possible values of PORTS_BIT_POS
19133  Returns:
19134  Latch read data.
19135  Example:
19136  <code>
19137  // read latch RC4
19138  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19139  PORTS_BIT_POS_4);
19140  </code>
19141  Remarks:
19142  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19143  should be used.
19144 
19145  This feature may not be available on all devices. Please refer to the
19146  specific device data sheet to determine availability or use
19147  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19148  this feature is available.
19149 */
19150 
19151 bool
19153  PORTS_MODULE_ID index ,
19154  PORTS_CHANNEL channel ,
19155  PORTS_BIT_POS bitPos ) ;
19156 // *****************************************************************************
19157 /* Function:
19158  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19159  PORTS_BIT_POS bitPos,
19160  bool value )
19161  Summary:
19162  Writes the selected digital pin/latch.
19163  Description:
19164  This function writes to the selected digital pin/latch.
19165  This function does not perform atomic register access.
19166  Precondition:
19167  None.
19168  Parameters:
19169  index - Identifier for the device instance to be configured
19170  channel - Identifier for the Ports channel A, B, C, etc.
19171  bitPos - Possible values of PORTS_BIT_POS
19172  value - Value to be written to the specific pin/latch
19173  true - sets the bit, false - clears the bit
19174  Returns:
19175  None.
19176  Example:
19177  <code>
19178 
19179  // write 'one' in port RC4
19180  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19181 
19182  </code>
19183  Remarks:
19184  This feature may not be available on all devices. Please refer to the
19185  specific device data sheet to determine availability or use
19186  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19187  this feature is available.
19188 */
19189 
19190 void
19192  PORTS_MODULE_ID index ,
19193  PORTS_CHANNEL channel ,
19194  PORTS_BIT_POS bitPos ,
19195  bool value ) ;
19196 // *****************************************************************************
19197 /* Function:
19198  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19199  PORTS_BIT_POS bitPos )
19200  Summary:
19201  Sets the selected digital pin/latch.
19202  Description:
19203  This function sets the selected digital pin/latch.
19204  This function does not perform atomic register access.
19205  Precondition:
19206  None.
19207  Parameters:
19208  index - Identifier for the device instance to be configured
19209  channel - Identifier for the Ports channel A, B, C, etc.
19210  bitPos - Possible values of PORTS_BIT_POS
19211  Returns:
19212  None.
19213  Example:
19214  <code>
19215 
19216  // Sets port pin RC4
19217  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19218 
19219  </code>
19220  Remarks:
19221  This feature may not be available on all devices. Please refer to the
19222  specific device data sheet to determine availability or use
19223  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19224  this feature is available.
19225 */
19226 
19227 void
19229  PORTS_MODULE_ID index ,
19230  PORTS_CHANNEL channel ,
19231  PORTS_BIT_POS bitPos ) ;
19232 // *****************************************************************************
19233 /* Function:
19234  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19235  PORTS_BIT_POS bitPos )
19236  Summary:
19237  Clears the selected digital pin/latch.
19238  Description:
19239  This function clears the selected digital pin/latch.
19240  This function does not perform atomic register access.
19241  Precondition:
19242  None.
19243  Parameters:
19244  index - Identifier for the device instance to be configured
19245  channel - Identifier for the Ports channel A, B, C, etc.
19246  bitPos - Possible values of PORTS_BIT_POS
19247  Returns:
19248  None.
19249  Example:
19250  <code>
19251 
19252  // Clears port pin RC4
19253  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19254 
19255  </code>
19256  Remarks:
19257  This feature may not be available on all devices. Please refer to the
19258  specific device data sheet to determine availability or use
19259  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19260  this feature is available.
19261 */
19262 
19263 void
19265  PORTS_MODULE_ID index ,
19266  PORTS_CHANNEL channel ,
19267  PORTS_BIT_POS bitPos ) ;
19268 // *****************************************************************************
19269 /* Function:
19270  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19271  PORTS_BIT_POS bitPos )
19272  Summary:
19273  Toggles the selected digital pin/latch.
19274  Description:
19275  This function toggles the selected digital pin/latch.
19276  This function does not perform atomic register access.
19277  Precondition:
19278  None.
19279  Parameters:
19280  index - Identifier for the device instance to be configured
19281  channel - Identifier for the Ports channel A, B, C, etc.
19282  bitPos - Possible values of PORTS_BIT_POS
19283  Returns:
19284  None.
19285  Example:
19286  <code>
19287 
19288  // Toggles port pin RC4
19289  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19290 
19291  </code>
19292  Remarks:
19293  This feature may not be available on all devices. Please refer to the
19294  specific device data sheet to determine availability or use
19295  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19296  this feature is available.
19297 */
19298 
19299 void
19301  PORTS_MODULE_ID index ,
19302  PORTS_CHANNEL channel ,
19303  PORTS_BIT_POS bitPos ) ;
19304 // *****************************************************************************
19305 /* Function:
19306  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19307  PORTS_BIT_POS bitPos )
19308  Summary:
19309  Makes the selected pin direction input
19310  Description:
19311  This function makes the selected pin direction as input
19312  This function does not perform atomic register access.
19313  Precondition:
19314  None.
19315  Parameters:
19316  index - Identifier for the device instance to be configured
19317  channel - Identifier for the Ports channel A, B, C, etc.
19318  bitPos - Possible values of PORTS_BIT_POS direction that has to
19319  be made input
19320  Returns:
19321  None.
19322  Example:
19323  <code>
19324 
19325  // make pin RC4 as input
19326  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19327 
19328  </code>
19329  Remarks:
19330  This feature may not be available on all devices. Please refer to the
19331  specific device data sheet to determine availability or use
19332  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19333  this feature is available.
19334 */
19335 
19336 void
19338  PORTS_MODULE_ID index ,
19339  PORTS_CHANNEL channel ,
19340  PORTS_BIT_POS bitPos ) ;
19341 // *****************************************************************************
19342 /* Function:
19343  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19344  PORTS_BIT_POS bitPos )
19345  Summary:
19346  Makes the selected pin direction output
19347  Description:
19348  This function makes the selected pin direction as output
19349  This function does not perform atomic register access.
19350  Precondition:
19351  None.
19352  Parameters:
19353  index - Identifier for the device instance to be configured
19354  channel - Identifier for the Ports channel A, B, C, etc.
19355  bitPos - Possible values of PORTS_BIT_POS direction that has to
19356  be made output
19357  Returns:
19358  None.
19359  Example:
19360  <code>
19361 
19362  // make pin RC4 as output
19363  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19364 
19365  </code>
19366  Remarks:
19367  This feature may not be available on all devices. Please refer to the
19368  specific device data sheet to determine availability or use
19369  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19370  this feature is available.
19371 */
19372 
19373 void
19375  PORTS_MODULE_ID index ,
19376  PORTS_CHANNEL channel ,
19377  PORTS_BIT_POS bitPos ) ;
19378 // *****************************************************************************
19379 /* Function:
19380  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19381  PORTS_BIT_POS bitPos )
19382  Summary:
19383  Enables the open drain functionality for the selected pin.
19384  Description:
19385  This function enables the open drain functionality for the selected pin.
19386  This function does not perform atomic register access.
19387  Precondition:
19388  None.
19389  Parameters:
19390  index - Identifier for the device instance to be configured
19391  channel - Identifier for the Ports channel A, B, C, etc.
19392  bitPos - Possible values of PORTS_BIT_POS
19393  Returns:
19394  None.
19395  Example:
19396  <code>
19397 
19398  // Enable open drain for pin RC4
19399  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19400 
19401  </code>
19402  Remarks:
19403  This feature may not be available on all devices. Please refer to the
19404  specific device data sheet to determine availability or use
19405  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19406  this feature is available.
19407 */
19408 
19409 void
19411  PORTS_MODULE_ID index ,
19412  PORTS_CHANNEL channel ,
19413  PORTS_BIT_POS bitPos ) ;
19414 // *****************************************************************************
19415 /* Function:
19416  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19417  PORTS_BIT_POS bitPos )
19418  Summary:
19419  Disables the open drain functionality for the selected pin.
19420  Description:
19421  This function disables the open drain functionality for the selected pin.
19422  This function does not perform atomic register access.
19423  Precondition:
19424  None.
19425  Parameters:
19426  index - Identifier for the device instance to be configured
19427  channel - Identifier for the Ports channel A, B, C, etc.
19428  bitPos - One of the possible values of PORTS_BIT_POS.
19429  Returns:
19430  None.
19431  Example:
19432  <code>
19433 
19434  // Disable open drain for pin RC4
19435  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19436 
19437  </code>
19438  Remarks:
19439  This feature may not be available on all devices. Please refer to the
19440  specific device data sheet to determine availability or use
19441  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19442  this feature is available.
19443 */
19444 
19445 void
19447  PORTS_MODULE_ID index ,
19448  PORTS_CHANNEL channel ,
19449  PORTS_BIT_POS bitPos ) ;
19450 // *****************************************************************************
19451 /* Function:
19452  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19453  (
19454  PORTS_MODULE_ID index,
19455  PORTS_CHANNEL channel
19456  )
19457  Summary:
19458  Reads and returns data from the selected Latch.
19459  Description:
19460  This function reads and returns the data from the selected Latch.
19461  This function does not perform atomic register access.
19462 
19463  Precondition:
19464  None.
19465  Parameters:
19466  index - Identifier for the device instance to be configured
19467  channel - Identifier for the Ports channel A, B, C, etc.
19468  Returns:
19469  Latch read data.
19470  Example:
19471  <code>
19472  // Read latch C
19473  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19474 
19475  </code>
19476  Remarks:
19477  For reading the Live data, PLIB_PORTS_Read function should be used.
19478 
19479  This feature may not be available on all devices. Please refer to the
19480  specific device data sheet to determine availability or use
19481  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19482  this feature is available.
19483 */
19484 
19487  PORTS_MODULE_ID index ,
19488  PORTS_CHANNEL channel ) ;
19489 // *****************************************************************************
19490 /* Function:
19491  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19492  Summary:
19493  Reads the selected digital port.
19494  Description:
19495  This function reads from the selected digital port.
19496  This function does not perform atomic register access.
19497  Precondition:
19498  None.
19499  Parameters:
19500  index - Identifier for the device instance to be configured
19501  channel - Identifier for the Ports channel A, B, C, etc.
19502  Returns:
19503  data on a port with width PORTS_DATA_TYPE
19504  Example:
19505  <code>
19506 
19507  // Read PORT C
19508  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19509 
19510  </code>
19511  Remarks:
19512  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19513 
19514  This feature may not be available on all devices. Please refer to the
19515  specific device data sheet to determine availability or use
19516  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19517  this feature is available.
19518 */
19519 
19521  PLIB_PORTS_Read (
19522  PORTS_MODULE_ID index ,
19523  PORTS_CHANNEL channel ) ;
19524 // *****************************************************************************
19525 /* Function:
19526  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19527  PORTS_DATA_TYPE value )
19528  Summary:
19529  Writes the selected digital port/latch.
19530  Description:
19531  This function writes to the selected digital port/latch.
19532  This function does not perform atomic register access.
19533  Precondition:
19534  None.
19535  Parameters:
19536  index - Identifier for the device instance to be configured
19537  channel - Identifier for the Ports channel A, B, C, etc.
19538  value - Value to be written into a port of width PORTS_DATA_TYPE
19539  Returns:
19540  None.
19541  Example:
19542  <code>
19543 
19544  // Write 0x12 into PORT C
19545  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19546 
19547  </code>
19548  Remarks:
19549  This feature may not be available on all devices. Please refer to the
19550  specific device data sheet to determine availability or use
19551  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19552  this feature is available.
19553 */
19554 
19555 void
19557  PORTS_MODULE_ID index ,
19558  PORTS_CHANNEL channel ,
19559  PORTS_DATA_TYPE value ) ;
19560 // *****************************************************************************
19561 /* Function:
19562  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19563  PORTS_DATA_TYPE value,
19564  PORTS_DATA_MASK mask )
19565  Summary:
19566  Sets the selected bits of the port.
19567  Description:
19568  This function performs an 'AND' operation on the value and mask parameters,
19569  and then sets the bits in the port channel that were set by the result of the
19570  'AND' operation.
19571  This function does not perform atomic register access.
19572  Precondition:
19573  None.
19574  Parameters:
19575  index - Identifier for the device instance to be configured
19576  channel - Identifier for the Ports channel A, B, C, etc.
19577  value - Consists of information about which port bit has to be
19578  set and which not
19579  mask - Identifies the bits which could be intended for setting
19580  Returns:
19581  None.
19582  Example:
19583  <code>
19584 
19585  // MY_VALUE - 0x1234
19586  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19587 
19588  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19589  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19590 
19591  </code>
19592  Remarks:
19593  This feature may not be available on all devices. Please refer to the
19594  specific device data sheet to determine availability or use
19595  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19596  this feature is available.
19597 */
19598 
19599 void
19600  PLIB_PORTS_Set (
19601  PORTS_MODULE_ID index ,
19602  PORTS_CHANNEL channel ,
19603  PORTS_DATA_TYPE value ,
19604  PORTS_DATA_MASK mask ) ;
19605 // *****************************************************************************
19606 /* Function:
19607  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19608  PORTS_DATA_MASK toggleMask )
19609  Summary:
19610  Toggles the selected digital port/latch.
19611  Description:
19612  This function toggles the selected digital port/latch.
19613  This function does not perform atomic register access.
19614  Precondition:
19615  None.
19616  Parameters:
19617  index - Identifier for the device instance to be configured
19618  channel - Identifier for the Ports channel A, B, C, etc.
19619  toggleMask - Identifies the bits to be toggled
19620  Returns:
19621  None.
19622  Example:
19623  <code>
19624 
19625  // Toggles the three least significant Port C bits
19626  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19627 
19628  </code>
19629  Remarks:
19630  This feature may not be available on all devices. Please refer to the
19631  specific device data sheet to determine availability or use
19632  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19633  this feature is available.
19634 */
19635 
19636 void
19638  PORTS_MODULE_ID index ,
19639  PORTS_CHANNEL channel ,
19640  PORTS_DATA_MASK toggleMask ) ;
19641 // *****************************************************************************
19642 /* Function:
19643  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19644  PORTS_DATA_MASK clearMask )
19645  Summary:
19646  Clears the selected digital port/latch bits.
19647  Description:
19648  This function clears the selected digital port/latch bits.
19649  This function does not perform atomic register access.
19650  Precondition:
19651  None.
19652  Parameters:
19653  index - Identifier for the device instance to be configured
19654  channel - Identifier for the Ports channel A, B, C, etc.
19655  clearMask - Identifies the bits to be cleared
19656  Returns:
19657  None.
19658  Example:
19659  <code>
19660 
19661  // Clears the three least significant Port C bits
19662  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19663 
19664  </code>
19665  Remarks:
19666  This feature may not be available on all devices. Please refer to the
19667  specific device data sheet to determine availability or use
19668  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19669  this feature is available.
19670 */
19671 
19672 void
19674  PORTS_MODULE_ID index ,
19675  PORTS_CHANNEL channel ,
19676  PORTS_DATA_MASK clearMask ) ;
19677 // *****************************************************************************
19678 /* Function:
19679  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19680  PORTS_DATA_MASK mask )
19681  Summary:
19682  Makes the selected pins direction input.
19683  Description:
19684  This function makes the selected pins direction input.
19685  This function does not perform atomic register access.
19686 
19687  Precondition:
19688  None.
19689  Parameters:
19690  index - Identifier for the device instance to be configured
19691  channel - Identifier for the Ports channel A, B, C, etc.
19692  mask - Identifies the pins direction that has to be made input
19693  Returns:
19694  None.
19695  Example:
19696  <code>
19697 
19698  // Make RC0, RC1 and RC2 pins as Input
19699  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19700 
19701  </code>
19702  Remarks:
19703  This feature may not be available on all devices. Please refer to the
19704  specific device data sheet to determine availability or use
19705  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19706  this feature is available.
19707 */
19708 
19709 void
19711  PORTS_MODULE_ID index ,
19712  PORTS_CHANNEL channel ,
19713  PORTS_DATA_MASK mask ) ;
19714 // *****************************************************************************
19715 /* Function:
19716  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19717  PORTS_DATA_MASK mask )
19718  Summary:
19719  Makes the selected pins direction output.
19720  Description:
19721  This function makes the selected pins direction output.
19722  This function does not perform atomic register access.
19723  Precondition:
19724  None.
19725  Parameters:
19726  index - Identifier for the device instance to be configured
19727  channel - Identifier for the Ports channel A, B, C, etc.
19728  mask - Identifies the pins direction that has to be made output
19729  Returns:
19730  None.
19731  Example:
19732  <code>
19733 
19734  // Make RC0, RC1 and RC2 pins as Output
19735  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19736 
19737  </code>
19738  Remarks:
19739  This feature may not be available on all devices. Please refer to the
19740  specific device data sheet to determine availability or use
19741  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19742  this feature is available.
19743 */
19744 
19745 void
19747  PORTS_MODULE_ID index ,
19748  PORTS_CHANNEL channel ,
19749  PORTS_DATA_MASK mask ) ;
19750 // *****************************************************************************
19751 /* Function:
19752  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19753  Summary:
19754  Reads the direction of the selected digital port.
19755  Description:
19756  This function reads the direction of the selected digital port.
19757  This function does not perform atomic register access.
19758  Precondition:
19759  None.
19760  Parameters:
19761  index - Identifier for the device instance to be configured
19762  channel - Identifier for the Ports channel A, B, C, etc.
19763  Returns:
19764  Direction of the selected port of type PORTS_DATA_MASK
19765  Example:
19766  <code>
19767 
19768  // Reads the direction of Port C pins
19769  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19770 
19771  </code>
19772  Remarks:
19773  This feature may not be available on all devices. Please refer to the
19774  specific device data sheet to determine availability or use
19775  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19776  this feature is available.
19777 */
19778 
19781  PORTS_MODULE_ID index ,
19782  PORTS_CHANNEL channel ) ;
19783 // *****************************************************************************
19784 /* Function:
19785  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19786  PORTS_DATA_MASK mask )
19787  Summary:
19788  Enables the open drain functionality for the selected port pins.
19789  Description:
19790  This function enables the open drain functionality for the selected port pins.
19791  This function does not perform atomic register access.
19792  Precondition:
19793  None.
19794  Parameters:
19795  index - Identifier for the device instance to be configured
19796  channel - Identifier for the Ports channel A, B, C, etc.
19797  mask - Identifies the pins for the open drain to be enabled
19798  Returns:
19799  None.
19800  Example:
19801  <code>
19802 
19803  // Enable Open Drain for RC0, RC1 and RC2 pins
19804  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19805 
19806  </code>
19807  Remarks:
19808  This feature may not be available on all devices. Please refer to the
19809  specific device data sheet to determine availability or use
19810  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19811  this feature is available.
19812 */
19813 
19814 void
19816  PORTS_MODULE_ID index ,
19817  PORTS_CHANNEL channel ,
19818  PORTS_DATA_MASK mask ) ;
19819 // *****************************************************************************
19820 /* Function:
19821  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19822  PORTS_DATA_MASK mask )
19823  Summary:
19824  Disables the open drain functionality for the selected port.
19825  Description:
19826  This function disables the open drain functionality for the selected port.
19827  This function does not perform atomic register access.
19828 
19829  Precondition:
19830  None.
19831  Parameters:
19832  index - Identifier for the device instance to be configured
19833  channel - Identifier for the Ports channel A, B, C, etc.
19834  mask - Identifies the pins for the open drain to be disabled
19835  Returns:
19836  None.
19837  Example:
19838  <code>
19839 
19840  // Disable Open Drain for RC0, RC1 and RC2 pins
19841  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19842 
19843  </code>
19844  Remarks:
19845  This feature may not be available on all devices. Please refer to the
19846  specific device data sheet to determine availability or use
19847  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19848  this feature is available.
19849 */
19850 
19851 void
19853  PORTS_MODULE_ID index ,
19854  PORTS_CHANNEL channel ,
19855  PORTS_DATA_MASK mask ) ;
19856 // *****************************************************************************
19857 /* Function:
19858  void PLIB_PORTS_ChannelModeSelect
19859  (
19860  PORTS_MODULE_ID index,
19861  PORTS_CHANNEL channel,
19862  PORTS_DATA_MASK modeMask,
19863  PORTS_PIN_MODE mode
19864  );
19865  Summary:
19866  Enables the selected channel pins as analog or digital.
19867  Description:
19868  This function enables the selected channel pins as analog or digital.
19869  This function does not perform atomic register access.
19870  Precondition:
19871  None.
19872  Parameters:
19873  index - Identifier for the device instance to be configured
19874  channel - Port pin channel
19875  modeMask - Identifies the pins whose mode has to be modified.
19876  Modes of the pins whose corresponding bit is '1' get
19877  modified, mode of the other pins remains the same.
19878  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19879  Returns:
19880  None.
19881  Example:
19882  <code>
19883 
19884  // Make pins RC5, RC8 and RC13 Analog
19885  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19886 
19887  </code>
19888  Remarks:
19889  This function is only available in devices with PPS. For Non-PPS devices, use the
19890  PLIB_PORTS_AnPinsModeSelect function.
19891 
19892  This feature may not be available on all devices. Please refer to the
19893  specific device data sheet to determine availability or use
19894  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19895  this feature is available.
19896 */
19897 
19898 void
19900  PORTS_MODULE_ID index ,
19901  PORTS_CHANNEL channel ,
19902  PORTS_DATA_MASK modeMask ,
19903  PORTS_PIN_MODE mode ) ;
19904 // *****************************************************************************
19905 /* Function:
19906  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19907  (
19908  PORTS_MODULE_ID index,
19909  PORTS_CHANNEL channel,
19910  PORTS_DATA_MASK mask
19911  );
19912  Summary:
19913  Enables Change Notice pull-up for the selected channel pins.
19914  Description:
19915  This function enables the Change Notice pull-up for the selected
19916  channel pins.
19917  This function does not perform atomic register access.
19918  Precondition:
19919  None.
19920  Parameters:
19921  index - Identifier for the device instance to be configured
19922  channel - Port pin channel
19923  mask - Identifies the pins of the pull-up to be enabled
19924  Returns:
19925  None.
19926  Example:
19927  <code>
19928 
19929  // Enable pull-up for RC5, RC8 and RC13 pins
19930  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
19931  0x2120);
19932  </code>
19933  Remarks:
19934  This function is only available in devices with PPS. For Non-PPS devices, use the
19935  PLIB_PORTS_CnPinsPullUpEnable function.
19936 
19937  This feature may not be available on all devices. Please refer to the
19938  specific device data sheet to determine availability or use
19939  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19940  determine whether this feature is available.
19941 */
19942 
19943 void
19945  PORTS_MODULE_ID index ,
19946  PORTS_CHANNEL channel ,
19947  PORTS_DATA_MASK mask ) ;
19948 // *****************************************************************************
19949 /* Function:
19950  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
19951  (
19952  PORTS_MODULE_ID index,
19953  PORTS_CHANNEL channel,
19954  PORTS_DATA_MASK mask
19955  );
19956  Summary:
19957  Disables Change Notice pull-up for the selected channel pins.
19958  Description:
19959  This function Disables the Change Notice pull-up for the selected
19960  channel pins.
19961  PLIB_PORTS_ChannelChangeNoticePullUpDisable
19962  Precondition:
19963  None.
19964  Parameters:
19965  index - Identifier for the device instance to be configured
19966  channel - Port pin channel
19967  mask - Identifies the pins of the pull-up to be disabled
19968  Returns:
19969  None.
19970  Example:
19971  <code>
19972 
19973  // Disable pull-up for RC5, RC8 and RC13 pins
19974  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
19975  0x2120);
19976  </code>
19977  Remarks:
19978  This function is only available in devices with PPS. For Non-PPS devices, use the
19979  PLIB_PORTS_CnPinsPullUpDisable function.
19980 
19981  This feature may not be available on all devices. Please refer to the
19982  specific device data sheet to determine availability or use
19983  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19984  determine whether this feature is available.
19985 */
19986 
19987 void
19989  PORTS_MODULE_ID index ,
19990  PORTS_CHANNEL channel ,
19991  PORTS_DATA_MASK mask ) ;
19992 // *****************************************************************************
19993 /* Function:
19994  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
19995  (
19996  PORTS_MODULE_ID index,
19997  PORTS_CHANNEL channel,
19998  PORTS_DATA_MASK mask
19999  );
20000  Summary:
20001  Enables Change Notice pull-down for the selected channel pins.
20002  Description:
20003  This function enables the Change Notice pull-down for the selected
20004  channel pins.
20005  This function does not perform atomic register access.
20006  Precondition:
20007  None.
20008  Parameters:
20009  index - Identifier for the device instance to be configured
20010  channel - Port pin channel
20011  mask - Identifies the pins for the pull-down to be enabled
20012  Returns:
20013  None.
20014  Example:
20015  <code>
20016 
20017  // Enable pull-down for RC5, RC8 and RC13 pins
20018  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20019  0x2120);
20020  </code>
20021  Remarks:
20022  This feature may not be available on all devices. Please refer to the
20023  specific device data sheet to determine availability or use
20024  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20025  determine whether this feature is available.
20026 */
20027 
20028 void
20030  PORTS_MODULE_ID index ,
20031  PORTS_CHANNEL channel ,
20032  PORTS_DATA_MASK mask ) ;
20033 // *****************************************************************************
20034 /* Function:
20035  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20036  (
20037  PORTS_MODULE_ID index,
20038  PORTS_CHANNEL channel,
20039  PORTS_DATA_MASK mask
20040  );
20041  Summary:
20042  Disables Change Notice pull-down for the selected channel pins.
20043  Description:
20044  This function Disables the Change Notice pull-down for the selected
20045  channel pins.
20046  This function does not perform atomic register access.
20047  Precondition:
20048  None.
20049  Parameters:
20050  index - Identifier for the device instance to be configured
20051  channel - Port pin channel
20052  mask - Identifies the pins for the pull-down to be disabled
20053  Returns:
20054  None.
20055  Example:
20056  <code>
20057 
20058  // Disable pull-down for RC5, RC8 and RC13 pins
20059  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20060  0x2120);
20061  </code>
20062  Remarks:
20063  This feature may not be available on all devices. Please refer to the
20064  specific device data sheet to determine availability or use
20065  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20066  determine whether this feature is available.
20067 */
20068 
20069 void
20071  PORTS_MODULE_ID index ,
20072  PORTS_CHANNEL channel ,
20073  PORTS_DATA_MASK mask ) ;
20074 // *****************************************************************************
20075 /* Function:
20076  void PLIB_PORTS_ChannelChangeNoticeEnable
20077  (
20078  PORTS_MODULE_ID index,
20079  PORTS_CHANNEL channel,
20080  PORTS_DATA_MASK mask
20081  );
20082  Summary:
20083  Enables CN interrupt for the selected pins of a channel.
20084  Description:
20085  This function enables Change Notice interrupt for the selected port
20086  pins of a channel.
20087  This function does not perform atomic register access.
20088  Precondition:
20089  None.
20090  Parameters:
20091  index - Identifier for the device instance to be configured
20092  channel - Port pin channel
20093  mask - Identifies the pins for which change notification is
20094  to be enabled
20095  Returns:
20096  None.
20097  Example:
20098  <code>
20099 
20100  // Enable CN interrupt for RC5, RC8 and RC13 pins
20101  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20102 
20103  </code>
20104  Remarks:
20105  This function is only available in devices with PPS. For Non-PPS devices, use the
20106  PLIB_PORTS_CnPinsEnable function.
20107 
20108  This feature may not be available on all devices. Please refer to the
20109  specific device data sheet to determine availability or use
20110  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20111  determine whether this feature is available.
20112 */
20113 
20114 void
20116  PORTS_MODULE_ID index ,
20117  PORTS_CHANNEL channel ,
20118  PORTS_DATA_MASK mask ) ;
20119 // *****************************************************************************
20120 /* Function:
20121  void PLIB_PORTS_ChannelChangeNoticeDisable
20122  (
20123  PORTS_MODULE_ID index,
20124  PORTS_CHANNEL channel,
20125  PORTS_DATA_MASK mask
20126  );
20127  Summary:
20128  Disables CN interrupt for the selected pins of a channel.
20129  Description:
20130  This function Disables Change Notice interrupt for the selected port
20131  pins of a channel.
20132  This function does not perform atomic register access.
20133  Precondition:
20134  None.
20135  Parameters:
20136  index - Identifier for the device instance to be configured
20137  channel - Port pin channel
20138  mask - Identifies the pins for which change notification is
20139  to be disabled
20140  Returns:
20141  None.
20142  Example:
20143  <code>
20144 
20145  // Disable CN interrupt for RC5, RC8 and RC13 pins
20146  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20147 
20148  </code>
20149  Remarks:
20150  This function is only available in devices with PPS. For Non-PPS devices, use the
20151  PLIB_PORTS_CnPinsDisable function.
20152 
20153  This feature may not be available on all devices. Please refer to the
20154  specific device data sheet to determine availability or use
20155  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20156  determine whether this feature is available.
20157 */
20158 
20159 void
20161  PORTS_MODULE_ID index ,
20162  PORTS_CHANNEL channel ,
20163  PORTS_DATA_MASK mask ) ;
20164 // *****************************************************************************
20165 /* Function:
20166  void PLIB_PORTS_AnPinsModeSelect
20167  (
20168  PORTS_MODULE_ID index,
20169  PORTS_AN_PIN anPins,
20170  PORTS_PIN_MODE mode
20171  );
20172  Summary:
20173  Enables the selected AN pins as analog or digital.
20174  Description:
20175  This function enables the selected AN pins as analog or digital.
20176  This function does not perform atomic register access.
20177  Precondition:
20178  None.
20179  Parameters:
20180  index - Identifier for the device instance to be configured
20181  anPins - AN pins whose mode is to be changed. Multiple AN pins
20182  can be ORed.
20183  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20184  Returns:
20185  None.
20186  Example:
20187  <code>
20188 
20189  // Make pins AN5, AN8 and AN13 Analog
20190  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20191  PORTS_AN_PIN_8 |
20192  PORTS_AN_PIN_13,
20193  PORTS_PIN_MODE_ANALOG);
20194 
20195  </code>
20196  Remarks:
20197  This function is only available in devices without PPS feature. For PPS
20198  devices, use the PLIB_PORTS_ChannelModeSelect function.
20199 
20200  This feature may not be available on all devices. Please refer to the
20201  specific device data sheet to determine availability or use
20202  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20203  this feature is available.
20204 */
20205 
20206 void
20208  PORTS_MODULE_ID index ,
20209  PORTS_AN_PIN anPins ,
20210  PORTS_PIN_MODE mode ) ;
20211 // *****************************************************************************
20212 /* Function:
20213  void PLIB_PORTS_CnPinsPullUpEnable
20214  (
20215  PORTS_MODULE_ID index,
20216  PORTS_CN_PIN cnPins
20217  );
20218  Summary:
20219  Enables Change Notice pull-up for the selected channel pins.
20220  Description:
20221  This function enables the Change Notice pull-up for the selected
20222  channel pins.
20223  This function performs atomic register access.
20224  Precondition:
20225  None.
20226  Parameters:
20227  index - Identifier for the device instance to be configured
20228  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20229  can be ORed.
20230  Returns:
20231  None.
20232  Example:
20233  <code>
20234 
20235  // Enable pull-up for CN5, CN8 and CN13 pins
20236  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20237  CHANGE_NOTICE_PIN_8 |
20238  CHANGE_NOTICE_PIN_13);
20239 
20240  </code>
20241  Remarks:
20242  This function is only available in devices without PPS feature. For PPS
20243  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20244 
20245  This feature may not be available on all devices. Please refer to the
20246  specific device data sheet to determine availability or use
20247  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20248  determine whether this feature is available.
20249 */
20250 
20251 void
20253  PORTS_MODULE_ID index ,
20254  PORTS_CN_PIN cnPins ) ;
20255 // *****************************************************************************
20256 /* Function:
20257  void PLIB_PORTS_CnPinsPullUpDisable
20258  (
20259  PORTS_MODULE_ID index,
20260  PORTS_CN_PIN cnPins
20261  );
20262  Summary:
20263  Disables Change Notice pull-up for the selected channel pins.
20264  Description:
20265  This function Disables the Change Notice pull-up for the selected
20266  channel pins.
20267  This function performs atomic register access.
20268  Precondition:
20269  None.
20270  Parameters:
20271  index - Identifier for the device instance to be configured
20272  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20273  can be ORed.
20274  Returns:
20275  None.
20276  Example:
20277  <code>
20278 
20279  // Disable pull-up for CN5, CN8 and CN13 pins
20280  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20281  CHANGE_NOTICE_PIN_5 |
20282  CHANGE_NOTICE_PIN_8 |
20283  CHANGE_NOTICE_PIN_13);
20284 
20285  </code>
20286  Remarks:
20287  This function is only available in devices without PPS feature. For PPS
20288  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20289 
20290  This feature may not be available on all devices. Please refer to the
20291  specific device data sheet to determine availability or use
20292  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20293  determine whether this feature is available.
20294 */
20295 
20296 void
20298  PORTS_MODULE_ID index ,
20299  PORTS_CN_PIN cnPins ) ;
20300 // *****************************************************************************
20301 /* Function:
20302  void PLIB_PORTS_CnPinsEnable
20303  (
20304  PORTS_MODULE_ID index,
20305  PORTS_CN_PIN cnPins
20306  );
20307  Summary:
20308  Enables CN interrupt for the selected pins of a channel.
20309  Description:
20310  This function enables Change Notice interrupt for the selected port
20311  pins of a channel.
20312  This function performs atomic register access.
20313  Precondition:
20314  None.
20315  Parameters:
20316  index - Identifier for the device instance to be configured
20317  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20318  Returns:
20319  None.
20320  Example:
20321  <code>
20322 
20323  // Enable CN interrupt for CN5, CN8 and CN13 pins
20324  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20325  CHANGE_NOTICE_PIN_5 |
20326  CHANGE_NOTICE_PIN_8 |
20327  CHANGE_NOTICE_PIN_13);
20328 
20329  </code>
20330  Remarks:
20331  This function is only available in devices without PPS feature. For PPS
20332  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20333 
20334  This feature may not be available on all devices. Please refer to the
20335  specific device data sheet to determine availability or use
20336  PLIB_PORTS_ExistsPinChangeNotice in your application to
20337  determine whether this feature is available.
20338 */
20339 
20340 void
20342  PORTS_MODULE_ID index ,
20343  PORTS_CN_PIN cnPins ) ;
20344 // *****************************************************************************
20345 /* Function:
20346  void PLIB_PORTS_CnPinsDisable
20347  (
20348  PORTS_MODULE_ID index,
20349  PORTS_CN_PIN cnPins
20350  );
20351  Summary:
20352  Disables CN interrupt for the selected pins of a channel.
20353  Description:
20354  This function Disables Change Notice interrupt for the selected port
20355  pins of a channel.
20356  This function performs atomic register access.
20357  Precondition:
20358  None.
20359  Parameters:
20360  index - Identifier for the device instance to be configured
20361  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20362  Returns:
20363  None.
20364  Example:
20365  <code>
20366 
20367  // Disable CN interrupt for CN5, CN8 and CN13 pins
20368  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20369  CHANGE_NOTICE_PIN_5 |
20370  CHANGE_NOTICE_PIN_8 |
20371  CHANGE_NOTICE_PIN_13);
20372 
20373  </code>
20374  Remarks:
20375  This function is only available in devices without PPS feature. For PPS
20376  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20377 
20378  This feature may not be available on all devices. Please refer to the
20379  specific device data sheet to determine availability or use
20380  PLIB_PORTS_ExistsPinChangeNotice in your application to
20381  determine whether this feature is available.
20382 */
20383 
20384 void
20386  PORTS_MODULE_ID index ,
20387  PORTS_CN_PIN cnPins ) ;
20388 // *****************************************************************************
20389 /* Function:
20390  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20391  Summary:
20392  Global Change Notice enable.
20393  Description:
20394  This function enables the global Change Notice feature.
20395  This function performs atomic register access.
20396  Precondition:
20397  None.
20398  Parameters:
20399  index - Identifier for the device instance to be configured
20400  Returns:
20401  None.
20402  Example:
20403  <code>
20404 
20405  // Enable Change Notification
20406  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20407 
20408  </code>
20409  Remarks:
20410  This function is only available in devices without PPS. For PPS devices, use the
20411  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20412 
20413  This feature may not be available on all devices. Please refer to the
20414  specific device data sheet to determine availability or use
20415  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20416  this feature is available.
20417 */
20418 
20419 void
20421  PORTS_MODULE_ID index ) ;
20422 // *****************************************************************************
20423 /* Function:
20424  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20425  Summary:
20426  Global Change Notice disable.
20427  Description:
20428  This function disables the global Change Notice feature.
20429  Precondition:
20430  None.
20431  Parameters:
20432  index - Identifier for the device instance to be configured
20433  Returns:
20434  None.
20435  Example:
20436  <code>
20437 
20438  // Disable Change Notification
20439  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20440 
20441  </code>
20442  Remarks:
20443  This function is only available in devices without PPS. For PPS devices, use the
20444  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20445 
20446  This feature may not be available on all devices. Please refer to the
20447  specific device data sheet to determine availability or use
20448  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20449  this feature is available.
20450 */
20451 
20452 void
20454  PORTS_MODULE_ID index ) ;
20455 // *****************************************************************************
20456 /* Function:
20457  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20458  PORTS_CHANGE_NOTICE_PIN pinNum )
20459  Summary:
20460  Port pin Change Notice interrupt enable.
20461  Description:
20462  This function enables the port pin Change Notice feature.
20463  This function performs atomic register access.
20464  Precondition:
20465  None.
20466  Parameters:
20467  index - Identifier for the device instance to be configured
20468  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20469  Returns:
20470  None.
20471  Example:
20472  <code>
20473 
20474  // Enable Change Notice interrupt for pin CN13
20475  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20476 
20477  </code>
20478  Remarks:
20479  This function is only available in devices without PPS. For PPS devices, use the
20480  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20481 
20482  This feature may not be available on all devices. Please refer to the
20483  specific device data sheet to determine availability or use
20484  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20485  this feature is available.
20486 */
20487 
20488 void
20490  PORTS_MODULE_ID index ,
20491  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20492 // *****************************************************************************
20493 /* Function:
20494  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20495  PORTS_CHANGE_NOTICE_PIN pinNum )
20496  Summary:
20497  Port pin Change Notice disable.
20498  Description:
20499  This function disables the port pin Change Notice feature.
20500  This function performs atomic register access.
20501  Precondition:
20502  None.
20503  Parameters:
20504  index - Identifier for the device instance to be configured
20505  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20506  Returns:
20507  None.
20508  Example:
20509  <code>
20510 
20511  // Disable Change Notice interrupt for pin CN13
20512  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20513 
20514  </code>
20515  Remarks:
20516  This function is only available in devices without PPS. For PPS devices, use the
20517  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20518 
20519  This feature may not be available on all devices. Please refer to the
20520  specific device data sheet to determine availability or use
20521  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20522  this feature is available.
20523 */
20524 
20525 void
20527  PORTS_MODULE_ID index ,
20528  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20529 // *****************************************************************************
20530 /* Function:
20531  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20532  Summary:
20533  CPU Idle mode does not affect Change Notice operation.
20534  Description:
20535  This function makes sure that Change Notice feature continues working in
20536  Idle mode.
20537  This function performs atomic register access.
20538 
20539  Precondition:
20540  None.
20541  Parameters:
20542  index - Identifier for the device instance to be configured
20543  Returns:
20544  None.
20545  Example:
20546  <code>
20547 
20548  // Change notification feature will be working even when CPU goes to
20549  // Idle mode
20550  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20551 
20552  </code>
20553  Remarks:
20554  This function is only available in devices without PPS. For PPS devices, use the
20555  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20556 
20557  This feature may not be available on all devices. Please refer to the
20558  specific device data sheet to determine availability or use
20559  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20560  this feature is available.
20561 */
20562 
20563 void
20565  PORTS_MODULE_ID index ) ;
20566 // *****************************************************************************
20567 /* Function:
20568  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20569  Summary:
20570  CPU Idle halts the Change Notice operation.
20571  Description:
20572  This function halts the Change Notice operation when the CPU enters
20573  Idle mode.
20574  This function performs atomic register access.
20575  Precondition:
20576  None.
20577  Parameters:
20578  index - Identifier for the device instance to be configured
20579  Returns:
20580  None.
20581  Example:
20582  <code>
20583  // Halts the Change notification operation when CPU enters Idle mode
20584  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20585 
20586  </code>
20587  Remarks:
20588  This function is only available in devices without PPS. For PPS devices, use the
20589  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20590 
20591  This feature may not be available on all devices. Please refer to the
20592  specific device data sheet to determine availability or use
20593  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20594  this feature is available.
20595 */
20596 
20597 void
20599  PORTS_MODULE_ID index ) ;
20600 // *****************************************************************************
20601 /* Function:
20602  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20603  PORTS_CHANGE_NOTICE_PIN pinNum )
20604  Summary:
20605  Enable pull-up on input change.
20606  Description:
20607  This function enables pull-up on selected input change notification pin.
20608  This function performs atomic register access.
20609  Precondition:
20610  None.
20611  Parameters:
20612  index - Identifier for the device instance to be configured
20613  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20614  Returns:
20615  None.
20616  Example:
20617  <code>
20618 
20619  // Enable pull-up on pin CN13
20620  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20621 
20622  </code>
20623  Remarks:
20624  This function is only available in devices without PPS. For PPS devices, use the
20625  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20626 
20627  This feature may not be available on all devices. Please refer to the
20628  specific device data sheet to determine availability or use
20629  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20630  this feature is available.
20631 */
20632 
20633 void
20635  PORTS_MODULE_ID index ,
20636  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20637 // *****************************************************************************
20638 /* Function:
20639  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20640  PORTS_CHANGE_NOTICE_PIN pinNum )
20641  Summary:
20642  Disable pull-up on input change.
20643  Description:
20644  This function disables pull-up on selected input change notification pin.
20645  This function performs atomic register access.
20646  Precondition:
20647  None.
20648  Parameters:
20649  index - Identifier for the device instance to be configured
20650  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20651  Returns:
20652  None.
20653  Example:
20654  <code>
20655 
20656  // Disable pull-up on pin CN13
20657  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20658 
20659  </code>
20660  Remarks:
20661  This function is only available in devices without PPS. For PPS devices, use the
20662  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20663 
20664  This feature may not be available on all devices. Please refer to the
20665  specific device data sheet to determine availability or use
20666  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20667  this feature is available.
20668 */
20669 
20670 void
20672  PORTS_MODULE_ID index ,
20673  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20674 // *****************************************************************************
20675 /* Function:
20676  void PLIB_PORTS_ChannelSlewRateSelect
20677  (
20678  PORTS_MODULE_ID index,
20679  PORTS_CHANNEL channel,
20680  PORTS_DATA_MASK channelMask,
20681  PORTS_PIN_SLEW_RATE slewRate
20682  );
20683  Summary:
20684  Selects the slew rate for selected channel pins.
20685  Description:
20686  This function selects the slew rate for selected channel pins.
20687  This function does not perform atomic register access.
20688  Precondition:
20689  None.
20690  Parameters:
20691  index - Identifier for the device instance to be configured
20692  channel - Port pin channel
20693  channelMask - Identifies the pins for which slew rate has to be modified.
20694  Slew rate of the pins which corresponding bit is "1" get
20695  modified, slew rate of the other pins remains the same.
20696  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20697  Returns:
20698  None.
20699  Example:
20700  <code>
20701 
20702  // Make slew rate of pins RC5, RC8 and RC13 slowest
20703  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20704  PORT_CHANNEL_C,
20705  0x2120,
20706  PORTS_PIN_SLEW_RATE_SLOWEST);
20707 
20708  </code>
20709  Remarks:
20710  This feature may not be available on all devices. Please refer to the
20711  specific device data sheet to determine availability or use
20712  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20713  whether this feature is available.
20714 */
20715 
20716 void
20718  PORTS_MODULE_ID index ,
20719  PORTS_CHANNEL channel ,
20720  PORTS_DATA_MASK channelMask ,
20721  PORTS_PIN_SLEW_RATE slewRate ) ;
20722 // *****************************************************************************
20723 /* Function:
20724 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20725  (
20726  PORTS_MODULE_ID index,
20727  PORTS_CHANNEL channel,
20728  PORTS_BIT_POS bitPos
20729  );
20730  Summary:
20731  Gets the slew rate for selected port pin.
20732  Description:
20733  This function gets the slew rate of selected port pin.
20734  This function does not perform atomic register access.
20735  Precondition:
20736  None.
20737  Parameters:
20738  index - Identifier for the device instance to be configured
20739  channel - Port pin channel
20740  bitPos - One of the possible values of PORTS_BIT_POS.
20741  Returns:
20742  One of the possible values of PORTS_PIN_SLEW_RATE.
20743  Example:
20744  <code>
20745  PORTS_PIN_SLEW_RATE slewRate;
20746 
20747  // Get the slew rate of pin RC1
20748  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20749 
20750  </code>
20751  Remarks:
20752  This feature may not be available on all devices. Please refer to the
20753  specific device data sheet to determine availability or use
20754  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20755  whether this feature is available.
20756 */
20757 
20758 PORTS_PIN_SLEW_RATE
20760  PORTS_MODULE_ID index ,
20761  PORTS_CHANNEL channel ,
20762  PORTS_BIT_POS bitPos ) ;
20763 // *****************************************************************************
20764 /* Function:
20765  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20766  (
20767  PORTS_MODULE_ID index,
20768  PORTS_CHANNEL channel,
20769  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20770  );
20771  Summary:
20772  Selects the Change Notice style for selected port channel.
20773  Description:
20774  This function selects the Change Notice style (or method) for selected port
20775  channel. It allows user to select whether the Change Notice detection will
20776  happen based on edge transition or level transition on all the CN pins of a
20777  particular channel.
20778  This function does not perform atomic register access.
20779  Precondition:
20780  None.
20781  Parameters:
20782  index - Identifier for the device instance to be configured
20783  channel - Port pin channel
20784  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20785  Returns:
20786  None.
20787  Example:
20788  <code>
20789  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20790  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20791  </code>
20792  Remarks:
20793  This feature may not be available on all devices. Please refer to the
20794  specific device data sheet to determine availability or use
20795  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20796  whether this feature is available.
20797 */
20798 
20799 void
20801  PORTS_MODULE_ID index ,
20802  PORTS_CHANNEL channel ,
20803  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20804 // *****************************************************************************
20805 /* Function:
20806  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20807  (
20808  PORTS_MODULE_ID index,
20809  PORTS_CHANNEL channel
20810  );
20811  Summary:
20812  Gets the Change Notice style for the selected port channel.
20813  Description:
20814  This function gets the Change Notice style (or method) for the selected port
20815  channel.
20816  This function does not perform atomic register access.
20817  Precondition:
20818  None.
20819  Parameters:
20820  index - Identifier for the device instance to be configured
20821  channel - Port pin channel
20822  Returns:
20823  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20824  Example:
20825  <code>
20826  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20827  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20828  </code>
20829  Remarks:
20830  This feature may not be available on all devices. Please refer to the
20831  specific device data sheet to determine availability or use
20832  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20833  whether this feature is available.
20834 */
20835 
20836 PORTS_CHANGE_NOTICE_METHOD
20838  PORTS_MODULE_ID index ,
20839  PORTS_CHANNEL channel ) ;
20840 // *****************************************************************************
20841 /* Function:
20842  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20843  (
20844  PORTS_MODULE_ID index,
20845  PORTS_CHANNEL channel,
20846  PORTS_DATA_MASK edgeRisingMask,
20847  PORTS_DATA_MASK edgeFallingMask
20848  );
20849  Summary:
20850  Enables selected type of edge for selected CN pins.
20851  Description:
20852  This function Enables selected type of edge (falling or rising) for
20853  selected CN pins of a port channel.
20854  This function does not perform atomic register access.
20855  Precondition:
20856  Change Notice method should be selected as
20857  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20858  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20859  Parameters:
20860  index - Identifier for the device instance to be configured
20861  channel - Port pin channel
20862  edgeRisingMask - Identifies the pins for which Change Notice has to be
20863  enabled for rising edge. Change Notice interrupt at rising
20864  edge is enabled for the pins which corresponding bit is
20865  '1', for the other pins it remains the same.
20866  edgeFallingMask - Identifies the pins for which Change Notice has to be
20867  enabled for falling edge. Change Notice interrupt at
20868  falling edge is enabled for the pins which corresponding
20869  bit is '1', for the other pins it remains the same.
20870  Returns:
20871  None.
20872  Example:
20873  <code>
20874  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20875  // RC1 & RC5 pins.
20876  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20877  </code>
20878  Remarks:
20879  This feature is not available on all devices. Please refer to the
20880  specific device data sheet to determine availability or use
20881  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20882  whether this feature is available.
20883 */
20884 
20885 void
20887  PORTS_MODULE_ID index ,
20888  PORTS_CHANNEL channel ,
20889  PORTS_DATA_MASK edgeRisingMask ,
20890  PORTS_DATA_MASK edgeFallingMask ) ;
20891 // *****************************************************************************
20892 /* Function:
20893  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20894  (
20895  PORTS_MODULE_ID index,
20896  PORTS_CHANNEL channel,
20897  PORTS_DATA_MASK edgeRisingMask,
20898  PORTS_DATA_MASK edgeFallingMask
20899  );
20900  Summary:
20901  Disables selected type of edge for selected CN pins.
20902  Description:
20903  This function Disables selected type of edge (falling or rising) for
20904  selected CN pins of a port channel.
20905  This function does not perform atomic register access.
20906  Precondition:
20907  Change Notice method should be selected as
20908  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20909  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20910  Parameters:
20911  index - Identifier for the device instance to be configured
20912  channel - Port pin channel
20913  edgeRisingMask - Identifies the pins for which Change Notice has to be
20914  enabled for rising edge. Change notice interrupt at rising
20915  edge is enabled for the pins which corresponding bit is
20916  '1', for the other pins it remains the same.
20917  edgeFallingMask - Identifies the pins for which Change Notice has to be
20918  enabled for falling edge. Change notice interrupt at
20919  falling edge is enabled for the pins which corresponding
20920  bit is '1', for the other pins it remains the same.
20921  Returns:
20922  None.
20923  Example:
20924  <code>
20925  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
20926  // RC1 & RC5 pins.
20927  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20928  </code>
20929  Remarks:
20930  This feature is not available on all devices. Please refer to the
20931  specific device data sheet to determine availability or use
20932  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20933  whether this feature is available.
20934 */
20935 
20936 void
20938  PORTS_MODULE_ID index ,
20939  PORTS_CHANNEL channel ,
20940  PORTS_DATA_MASK edgeRisingMask ,
20941  PORTS_DATA_MASK edgeFallingMask ) ;
20942 // *****************************************************************************
20943 /* Function:
20944  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
20945  (
20946  PORTS_MODULE_ID index,
20947  PORTS_CHANNEL channel,
20948  PORTS_BIT_POS bitPos,
20949  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
20950  );
20951  Summary:
20952  Check if Change Notice edge is enabled or not.
20953  This function does not perform atomic register access.
20954  Description:
20955  This function checks if selected type of Change Notice edge is enabled on a
20956  particular port pin or not.
20957  This function does not perform atomic register access.
20958  Precondition:
20959  None.
20960  Parameters:
20961  index - Identifier for the device instance to be configured
20962  channel - Port pin channel
20963  bitPos - One of the possible values of PORTS_BIT_POS.
20964  cnEdgeType - Type of the edge which has to be checked.
20965 
20966  Returns:
20967  - true - Selected type of Change Notice Edge is enabled.
20968  - false - Selected type of Change Notice Edge is not enabled.
20969 
20970  Example:
20971  <code>
20972  // Check if Change Notice at rising edge is enabled or not for pin RC1.
20973  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
20974  {
20975  // do something
20976  }
20977  </code>
20978  Remarks:
20979  This feature is not available on all devices. Please refer to the
20980  specific device data sheet to determine availability or use
20981  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20982  whether this feature is available.
20983 */
20984 
20985 bool
20987  PORTS_MODULE_ID index ,
20988  PORTS_CHANNEL channel ,
20989  PORTS_BIT_POS bitPos ,
20990  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
20991 // *****************************************************************************
20992 /* Function:
20993  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
20994  (
20995  PORTS_MODULE_ID index,
20996  PORTS_CHANNEL channel,
20997  PORTS_BIT_POS bitPos
20998  );
20999  Summary:
21000  Check Change Notice edge status.
21001  Description:
21002  This function checks whether or no a Change Notice edge transition has occurred
21003  on the selected port pin.
21004  This function does not perform atomic register access.
21005  Precondition:
21006  None.
21007  Parameters:
21008  index - Identifier for the device instance to be configured
21009  channel - Port pin channel
21010  bitPos - One of the possible values of PORTS_BIT_POS
21011 
21012  Returns:
21013  - true - Change Notice edge transition has occurred
21014  - false - Change Notice edge transition has not occurred
21015 
21016  Example:
21017  <code>
21018  // Check if Change Notice edge transition has occurred for pin RC1.
21019  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21020  {
21021  // do something
21022  }
21023  </code>
21024  Remarks:
21025  This feature is not available on all devices. Please refer to the
21026  specific device data sheet to determine availability or use
21027  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21028  whether this feature is available.
21029 */
21030 
21031 bool
21033  PORTS_MODULE_ID index ,
21034  PORTS_CHANNEL channel ,
21035  PORTS_BIT_POS bitPos ) ;
21036 // *****************************************************************************
21037 // *****************************************************************************
21038 // Section: Ports Peripheral Library Exists Functions
21039 // *****************************************************************************
21040 // *****************************************************************************
21041 /* The functions below indicate the existence of the features on the device.
21042 */
21043 //******************************************************************************
21044 /* Function:
21045  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21046  Summary:
21047  Identifies whether the RemapInput feature exists on the Ports module.
21048  Description:
21049  This function identifies whether the RemapInput feature is available on the
21050  Ports module.
21051  When this function returns true, this function is supported on the device:
21052  - PLIB_PORTS_RemapInput
21053  Preconditions:
21054  None.
21055  Parameters:
21056  index - Identifier for the device instance
21057  Returns:
21058  - true - The RemapInput feature is supported on the device
21059  - false - The RemapInput feature is not supported on the device
21060  Remarks:
21061  None.
21062 */
21063 
21064 bool
21066  PORTS_MODULE_ID index ) ;
21067 //******************************************************************************
21068 /* Function:
21069  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21070  Summary:
21071  Identifies whether the RemapOutput feature exists on the Ports module.
21072  Description:
21073  This function identifies whether the RemapOutput feature is available on the
21074  Ports module.
21075  When this function returns true, this function is supported on the device:
21076  - PLIB_PORTS_RemapOutput
21077  Preconditions:
21078  None.
21079  Parameters:
21080  index - Identifier for the device instance
21081  Returns:
21082  - true - The RemapOutput feature is supported on the device
21083  - false - The RemapOutput feature is not supported on the device
21084  Remarks:
21085  None.
21086 */
21087 
21088 bool
21090  PORTS_MODULE_ID index ) ;
21091 //******************************************************************************
21092 /* Function:
21093  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21094  Summary:
21095  Identifies whether the PinMode feature exists on the Ports module.
21096  Description:
21097  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21098  feature is available on the Ports module.
21099  When this function returns true, this function is supported on the device:
21100  - PLIB_PORTS_PinModeSelect
21101  Preconditions:
21102  None.
21103  Parameters:
21104  index - Identifier for the device instance
21105  Returns:
21106  - true - The PinMode feature is supported on the device
21107  - false - The PinMode feature is not supported on the device
21108  Remarks:
21109  None.
21110 */
21111 
21112 bool
21114  PORTS_MODULE_ID index ) ;
21115 //******************************************************************************
21116 /* Function:
21117  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21118  Summary:
21119  Identifies whether the AnPinsMode feature exists on the Ports module.
21120  Description:
21121  This function identifies whether the AnPinsMode feature is available on the
21122  Ports module.
21123  When this function returns true, this function is supported on the device:
21124  - PLIB_PORTS_AnPinsModeSelect
21125  Preconditions:
21126  None.
21127  Parameters:
21128  index - Identifier for the device instance
21129  Returns:
21130  - true - The AnPinsMode feature is supported on the device
21131  - false - The AnPinsMode feature is not supported on the device
21132  Remarks:
21133  None.
21134 */
21135 
21136 bool
21138  PORTS_MODULE_ID index ) ;
21139 //******************************************************************************
21140 /* Function:
21141  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21142  Summary:
21143  Identifies whether the PortsRead feature exists on the Ports module.
21144  Description:
21145  This function identifies whether the PortsRead feature is available on the
21146  Ports module.
21147  When this function returns true, these functions are supported on the device:
21148  - PLIB_PORTS_PinGet
21149  - PLIB_PORTS_Read
21150  Preconditions:
21151  None.
21152  Parameters:
21153  index - Identifier for the device instance
21154  Returns:
21155  - true - The PortsRead feature is supported on the device
21156  - false - The PortsRead feature is not supported on the device
21157  Remarks:
21158  None.
21159 */
21160 
21161 bool
21163  PORTS_MODULE_ID index ) ;
21164 //******************************************************************************
21165 /* Function:
21166  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21167  Summary:
21168  Identifies whether the LatchRead feature exists on the Ports module.
21169  Description:
21170  This function identifies whether the LatchRead feature is available on the
21171  Ports module.
21172  When this function returns true, these functions are supported on the device:
21173  - PLIB_PORTS_PinGetLatched
21174  - PLIB_PORTS_ReadLatched
21175  Preconditions:
21176  None.
21177  Parameters:
21178  index - Identifier for the device instance
21179  Returns:
21180  - true - The LatchRead feature is supported on the device
21181  - false - The LatchRead feature is not supported on the device
21182  Remarks:
21183  None.
21184 */
21185 
21186 bool
21188  PORTS_MODULE_ID index ) ;
21189 //******************************************************************************
21190 /* Function:
21191  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21192  Summary:
21193  Identifies whether the PortsWrite feature exists on the Ports module.
21194  Description:
21195  This function identifies whether the PortsWrite feature is available on the
21196  Ports module.
21197  When this function returns true, these functions are supported on the device:
21198  - PLIB_PORTS_PinWrite
21199  - PLIB_PORTS_PinSet
21200  - PLIB_PORTS_PinClear
21201  - PLIB_PORTS_PinToggle
21202  - PLIB_PORTS_Write
21203  - PLIB_PORTS_Set
21204  - PLIB_PORTS_Toggle
21205  - PLIB_PORTS_Clear
21206  Preconditions:
21207  None.
21208  Parameters:
21209  index - Identifier for the device instance
21210  Returns:
21211  - true - The PortsWrite feature is supported on the device
21212  - false - The PortsWrite feature is not supported on the device
21213  Remarks:
21214  None.
21215 */
21216 
21217 bool
21219  PORTS_MODULE_ID index ) ;
21220 //******************************************************************************
21221 /* Function:
21222  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21223  Summary:
21224  Identifies whether the PortsDirection feature exists on the Ports module.
21225  Description:
21226  This function identifies whether the PortsDirection feature is available on the
21227  Ports module.
21228  When this function returns true, these functions are supported on the device:
21229  - PLIB_PORTS_PinDirectionInputSet
21230  - PLIB_PORTS_PinDirectionOutputSet
21231  - PLIB_PORTS_DirectionInputSet
21232  - PLIB_PORTS_DirectionOutputSet
21233  - PLIB_PORTS_DirectionGet
21234  Preconditions:
21235  None.
21236  Parameters:
21237  index - Identifier for the device instance
21238  Returns:
21239  - true - The PortsDirection feature is supported on the device
21240  - false - The PortsDirection feature is not supported on the device
21241  Remarks:
21242  None.
21243 */
21244 
21245 bool
21247  PORTS_MODULE_ID index ) ;
21248 //******************************************************************************
21249 /* Function:
21250  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21251  Summary:
21252  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21253  Description:
21254  This function identifies whether the PortsOpenDrain feature is available on
21255  the Ports module.
21256  When this function returns true, these functions are supported on the device:
21257  - PLIB_PORTS_PinOpenDrainEnable
21258  - PLIB_PORTS_PinOpenDrainDisable
21259  - PLIB_PORTS_OpenDrainEnable
21260  - PLIB_PORTS_OpenDrainDisable
21261  Preconditions:
21262  None.
21263  Parameters:
21264  index - Identifier for the device instance
21265  Returns:
21266  - true - The PortsOpenDrain feature is supported on the device
21267  - false - The PortsOpenDrain feature is not supported on the device
21268  Remarks:
21269  None.
21270 */
21271 
21272 bool
21274  PORTS_MODULE_ID index ) ;
21275 //******************************************************************************
21276 /* Function:
21277  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21278  Summary:
21279  Identifies whether the ChangeNotice feature exists on the Ports module.
21280  Description:
21281  This function identifies whether the ChangeNotice feature is available on the
21282  Ports module.
21283  When this function returns true, these functions are supported on the device:
21284  - PLIB_PORTS_ChangeNoticeEnable
21285  - PLIB_PORTS_ChangeNoticeDisable
21286  Preconditions:
21287  None.
21288  Parameters:
21289  index - Identifier for the device instance
21290  Returns:
21291  - true - The ChangeNotice feature is supported on the device
21292  - false - The ChangeNotice feature is not supported on the device
21293  Remarks:
21294  None.
21295 */
21296 
21297 bool
21299  PORTS_MODULE_ID index ) ;
21300 //******************************************************************************
21301 /* Function:
21302  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21303  Summary:
21304  Identifies whether the PinChangeNotice feature exists on the Ports module.
21305  Description:
21306  This function identifies whether the PinChangeNotice feature is available on
21307  the Ports module.
21308  When this function returns true, these functions are supported on the device:
21309  - PLIB_PORTS_PinChangeNoticeEnable
21310  - PLIB_PORTS_PinChangeNoticeDisable
21311  - PLIB_PORTS_CnPinsEnable
21312  - PLIB_PORTS_CnPinsDisable
21313  Preconditions:
21314  None.
21315  Parameters:
21316  index - Identifier for the device instance
21317  Returns:
21318  - true - The PinChangeNotice feature is supported on the device
21319  - false - The PinChangeNotice feature is not supported on the device
21320  Remarks:
21321  None.
21322 */
21323 
21324 bool
21326  PORTS_MODULE_ID index ) ;
21327 //******************************************************************************
21328 /* Function:
21329  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21330  Summary:
21331  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21332  Description:
21333  This function identifies whether the ChangeNoticeInIdle feature is available
21334  on the Ports module.
21335  When this function returns true, these functions are supported on the device:
21336  - PLIB_PORTS_ChangeNoticeInIdleEnable
21337  - PLIB_PORTS_ChangeNoticeInIdleDisable
21338  Preconditions:
21339  None.
21340  Parameters:
21341  index - Identifier for the device instance
21342  Returns:
21343  - true - The ChangeNoticeInIdle feature is supported on the device
21344  - false - The ChangeNoticeInIdle feature is not supported on the device
21345  Remarks:
21346  None.
21347 */
21348 
21349 bool
21351  PORTS_MODULE_ID index ) ;
21352 //******************************************************************************
21353 /* Function:
21354  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21355  Summary:
21356  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21357  Description:
21358  This function identifies whether the ChangeNoticePullup feature is available
21359  on the Ports module.
21360  When this function returns true, these functions are supported on the device:
21361  - PLIB_PORTS_ChangeNoticePullUpEnable
21362  - PLIB_PORTS_ChangeNoticePullUpDisable
21363  - PLIB_PORTS_CnPinsPullUpEnable
21364  - PLIB_PORTS_CnPinsPullUpDisable
21365  Preconditions:
21366  None.
21367  Parameters:
21368  index - Identifier for the device instance
21369  Returns:
21370  - true - The ChangeNoticePullup feature is supported on the device
21371  - false - The ChangeNoticePullup feature is not supported on the device
21372  Remarks:
21373  None.
21374 */
21375 
21376 bool
21378  PORTS_MODULE_ID index ) ;
21379 //******************************************************************************
21380 /* Function:
21381  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21382  Summary:
21383  Identifies whether the PinModePerPort feature exists on the Ports module.
21384  Description:
21385  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21386  feature is available on the Ports module.
21387  When this function returns true, these functions are supported on the device:
21388  - PLIB_PORTS_PinModePerPortSelect
21389  - PLIB_PORTS_ChannelModeSelect
21390  Preconditions:
21391  None.
21392  Parameters:
21393  index - Identifier for the device instance
21394  Returns:
21395  - true - The PinModePerPort feature is supported on the device
21396  - false - The PinModePerPort feature is not supported on the device
21397  Remarks:
21398  None.
21399 */
21400 
21401 bool
21403  PORTS_MODULE_ID index ) ;
21404 //******************************************************************************
21405 /* Function:
21406  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21407  Summary:
21408  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21409  Ports module.
21410  Description:
21411  This function identifies whether the ChangeNoticePullDownPerPort feature is
21412  available on the Ports module.
21413  When this function returns true, these functions are supported on the device:
21414  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21415  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21416  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21417  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21418  Preconditions:
21419  None.
21420  Parameters:
21421  index - Identifier for the device instance
21422  Returns:
21423  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21424  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21425  Remarks:
21426  None.
21427 */
21428 
21429 bool
21431  PORTS_MODULE_ID index ) ;
21432 //******************************************************************************
21433 /* Function:
21434  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21435  Summary:
21436  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21437  module.
21438  Description:
21439  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21440  on the Ports module.
21441  When this function returns true, these functions are supported on the device:
21442  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21443  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21444  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21445  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21446  Preconditions:
21447  None.
21448  Parameters:
21449  index - Identifier for the device instance
21450  Returns:
21451  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21452  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21453  Remarks:
21454  None.
21455 */
21456 
21457 bool
21459  PORTS_MODULE_ID index ) ;
21460 //******************************************************************************
21461 /* Function:
21462  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21463  Summary:
21464  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21465  module.
21466  Description:
21467  This function identifies whether the PinChangeNoticePerPort feature is
21468  available on the Ports module.
21469  When this function returns true, these functions are supported on the device:
21470  - PLIB_PORTS_PinChangeNoticePerPortEnable
21471  - PLIB_PORTS_PinChangeNoticePerPortDisable
21472  - PLIB_PORTS_ChannelChangeNoticeEnable
21473  - PLIB_PORTS_ChannelChangeNoticeDisable
21474  Preconditions:
21475  None.
21476  Parameters:
21477  index - Identifier for the device instance
21478  Returns:
21479  - true - The PinChangeNoticePerPort feature is supported on the device
21480  - false - The PinChangeNoticePerPort feature is not supported on the device
21481  Remarks:
21482  None.
21483 */
21484 
21485 bool
21487  PORTS_MODULE_ID index ) ;
21488 //******************************************************************************
21489 /* Function:
21490  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21491  Summary:
21492  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21493  module.
21494  Description:
21495  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21496  available on the Ports module.
21497  When this function returns true, these functions are supported on the device:
21498  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21499  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21500  Preconditions:
21501  None.
21502  Parameters:
21503  index - Identifier for the device instance
21504  Returns:
21505  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21506  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21507  Remarks:
21508  None.
21509 */
21510 
21511 bool
21513  PORTS_MODULE_ID index ) ;
21514 //******************************************************************************
21515 /* Function:
21516  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21517  Summary:
21518  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21519  module.
21520  Description:
21521  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21522  available on the Ports module.
21523  When this function returns true, these functions are supported on the device:
21524  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21525  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21526  Preconditions:
21527  None.
21528  Parameters:
21529  index - Identifier for the device instance
21530  Returns:
21531  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21532  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21533  Remarks:
21534  None.
21535 */
21536 
21537 bool
21539  PORTS_MODULE_ID index ) ;
21540 //******************************************************************************
21541 /* Function:
21542  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21543  Summary:
21544  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21545  module.
21546  Description:
21547  This function identifies whether the ChangeNoticePerPortStatus feature is
21548  available on the Ports module.
21549  When this function returns true, these functions are supported on the device:
21550  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21551  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21552  Preconditions:
21553  None.
21554  Parameters:
21555  index - Identifier for the device instance
21556  Returns:
21557  - true - The ChangeNoticePerPortStatus feature is supported on the device
21558  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21559  Remarks:
21560  None.
21561 */
21562 
21563 bool
21565  PORTS_MODULE_ID index ) ;
21566 //******************************************************************************
21567 /* Function:
21568  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21569  Summary:
21570  Identifies whether the SlewRateControl feature exists on the Ports module.
21571  Description:
21572  This function identifies whether the SlewRateControl feature is available
21573  on the Ports module.
21574  When this function returns true, these functions are supported on the device:
21575  - PLIB_PORTS_ChannelSlewRateSelect
21576  - PLIB_PORTS_PinSlewRateGet
21577  Preconditions:
21578  None.
21579  Parameters:
21580  index - Identifier for the device instance
21581  Returns:
21582  - true - The SlewRateControl feature is supported on the device
21583  - false - The SlewRateControl feature is not supported on the device
21584  Remarks:
21585  None.
21586 */
21587 
21588 bool
21590  PORTS_MODULE_ID index ) ;
21591 //******************************************************************************
21592 /* Function:
21593  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21594  Summary:
21595  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21596  Ports module.
21597  Description:
21598  This function identifies whether the ChannelChangeNoticeMethod feature is
21599  available on the Ports module.
21600  When this function returns true, these functions are supported on the device:
21601  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21602  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21603  Preconditions:
21604  None.
21605  Parameters:
21606  index - Identifier for the device instance
21607  Returns:
21608  - true - The ChannelChangeNoticeMethod feature is supported on the device
21609  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21610  Remarks:
21611  None.
21612 */
21613 
21614 bool
21616  PORTS_MODULE_ID index ) ;
21617 //******************************************************************************
21618 /* Function:
21619  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21620  Summary:
21621  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21622  module.
21623  Description:
21624  This function identifies whether the ChangeNoticeEdgeControl feature is
21625  available on the Ports module.
21626  When this function returns true, these functions are supported on the device:
21627  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21628  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21629  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21630  Preconditions:
21631  None.
21632  Parameters:
21633  index - Identifier for the device instance
21634  Returns:
21635  - true - The ChangeNoticeEdgeControl feature is supported on the device
21636  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21637  Remarks:
21638  None.
21639 */
21640 
21641 bool
21643  PORTS_MODULE_ID index ) ;
21644 //******************************************************************************
21645 /* Function:
21646  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21647  Summary:
21648  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21649  module.
21650  Description:
21651  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21652  on the Ports module.
21653  When this function returns true, this function is supported on the device:
21654  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21655  Preconditions:
21656  None.
21657  Parameters:
21658  index - Identifier for the device instance
21659  Returns:
21660  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21661  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21662  Remarks:
21663  None.
21664 */
21665 
21666 bool
21668  PORTS_MODULE_ID index ) ;
21669 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21670 /*******************************************************************************
21671  Ports Peripheral Library Compatibility Header
21672  Company:
21673  Microchip Technology Inc.
21674  File Name:
21675  plib_ports_compatibility.h
21676  Summary:
21677  Ports Peripheral Library Interface header for backward compatibility.
21678  Description:
21679  This header file contains the definitions of the functions which are
21680  supported for backward compatibility only. These will be deprecated later.
21681 *******************************************************************************/
21682 // DOM-IGNORE-BEGIN
21683 /*******************************************************************************
21684 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21685 Microchip licenses to you the right to use, modify, copy and distribute
21686 Software only when embedded on a Microchip microcontroller or digital signal
21687 controller that is integrated into your product or third party product
21688 (pursuant to the sublicense terms in the accompanying license agreement).
21689 You should refer to the license agreement accompanying this Software for
21690 additional information regarding your rights and obligations.
21691 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21692 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21693 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21694 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21695 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21696 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21697 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21698 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21699 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21700 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21701 *******************************************************************************/
21702 // DOM-IGNORE-END
21703 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21704 #define _PLIB_PORTS_COMPATIBILITY_H
21705 #include <stdint.h>
21706 #include <stddef.h>
21707 // *****************************************************************************
21708 /* Function:
21709  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21710  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21711  Summary:
21712  checks the status of change on the pin
21713  Description:
21714  This function checks if the change has occurred on the given pin or not.
21715  Precondition:
21716  None.
21717  Parameters:
21718  index - Identifier for the device instance to be configured
21719  channel - Port pin channel
21720  bitPos - Position in the PORT pins
21721  Returns:
21722  None.
21723  Example:
21724  <code>
21725 
21726  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21727  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21728  {
21729  //do something
21730  }
21731 
21732  </code>
21733  Remarks:
21734  This feature may not be available on all devices. Please refer to the
21735  specific device data sheet to determine availability or use
21736  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21737  whether this feature is available.
21738 
21739  This function will be deprecated later.
21740 */
21741 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21742  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21743 /*******************************************************************************
21744  End of File
21745 */
21746 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21747 /* CLOSE_FILE Include File */
21748 
21749 //DOM-IGNORE-BEGIN
21750 //DOM-IGNORE-END
21751  // #ifndef _PLIB_PORTS_H
21752 /*******************************************************************************
21753  End of File
21754 */
21755 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21756 /* CLOSE_FILE Include File */
21757 
21758 #include "system/int/sys_int.h"
21759 // *****************************************************************************
21760 // *****************************************************************************
21761 // Section: SYS PORTS Data Types
21762 // *****************************************************************************
21763 // *****************************************************************************
21764 // *****************************************************************************
21765 /* SYS PORTS PULLUP status
21766  Summary:
21767  Provides the pull-up and pull-down status.
21768  Description:
21769  These constants provide the pull-up or pull-down status definitions.
21770  Remarks:
21771  None.
21772 */
21773 
21774 typedef
21775  enum
21776  {
21777  /* PULLUP Disable */
21779  /*DOM-IGNORE-BEGIN*/
21780  = 0 /*DOM-IGNORE-END*/
21781  ,
21782  /* PULLUP Enable */
21784  /*DOM-IGNORE-BEGIN*/
21785  = 1 /*DOM-IGNORE-END*/
21786  ,
21788 // *****************************************************************************
21789 /* SYS PORTS PIN DIRECTION
21790  Summary:
21791  Defines the direction of the port pins.
21792  Description:
21793  These constants provide the port pin direction definitions.
21794  Remarks:
21795  None.
21796 */
21797 
21798 typedef
21799  enum
21800  {
21801  /* Direction as output */
21803  /*DOM-IGNORE-BEGIN*/
21804  = 0 /*DOM-IGNORE-END*/
21805  ,
21806  /* Direction as input */
21808  /*DOM-IGNORE-BEGIN*/
21809  = 1 /*DOM-IGNORE-END*/
21810  ,
21812 
21813 typedef
21814  enum
21815  {
21818  // #ifndef _SYS_PORTS_DEFINITIONS_H
21819 /*******************************************************************************
21820  End of File
21821 */
21822 
21823 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21824 /* CLOSE_FILE Include File */
21825 
21826 // DOM-IGNORE-BEGIN
21827 // DOM-IGNORE-END
21828 // *****************************************************************************
21829 // *****************************************************************************
21830 // Section: SYS PorTS Module Initialization Routine
21831 // *****************************************************************************
21832 // *****************************************************************************
21833 // *****************************************************************************
21834 /* Function:
21835  void SYS_PORTS_Initialize()
21836  Summary:
21837  Initializes PORT Pins/Channels.
21838  <p><b>Implementation:</b> Static/Dynamic</p>
21839  Description:
21840  This function initializes different port pins/channels to the desired state.
21841  It also remaps the pins to the desired specific function.
21842  Precondition:
21843  None.
21844  Parameters:
21845  None.
21846  Returns:
21847  None.
21848  Example:
21849  <code>
21850  SYS_PORTS_Initialize();
21851  </code>
21852  Remarks:
21853  This API must be be called at the time of system initialization to
21854  initialize the ports pins.
21855 */
21856 
21857 void
21859 // *****************************************************************************
21860 // *****************************************************************************
21861 // Section: SYS PORTS CONTROL Routines
21862 // *****************************************************************************
21863 // *****************************************************************************
21864 // *****************************************************************************
21865 /* Function:
21866  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21867  Summary:
21868  Reads the data from the I/O port.
21869  <p><b>Implementation:</b> Dynamic</p>
21870  Description:
21871  This function reads the data from the I/O port.
21872  Preconditions:
21873  The direction of the port to be set as input.
21874  Parameters:
21875  index - Identifier for the device instance to be configured
21876  channel - Identifier for the PORT channel: A, B, C, etc.
21877  Returns:
21878  Returns the data read from the port.
21879  Example:
21880  <code>
21881  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21882  // application developer.
21883  PORTS_DATA_TYPE readData;
21884  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21885  </code>
21886  Remarks:
21887  None.
21888 */
21889 
21891  SYS_PORTS_Read (
21892  PORTS_MODULE_ID index ,
21893  PORTS_CHANNEL channel ) ;
21894 // *****************************************************************************
21895 /* Function:
21896  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21897  PORTS_CHANNEL channel,
21898  PORTS_DATA_TYPE value )
21899  Summary:
21900  Writes the data to the I/O port.
21901  <p><b>Implementation:</b> Dynamic</p>
21902  Description:
21903  This function writes the data to the I/O port.
21904  Preconditions:
21905  The direction of the port to be set as output.
21906  Parameters:
21907  index - Identifier for the device instance to be configured
21908  channel - Identifier for the PORT channel: A, B, C, etc.
21909  value - Value to be written into a port of width PORTS_DATA_TYPE
21910  Returns:
21911  None.
21912  Example:
21913  <code>
21914  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21915  // application developer.
21916  PORTS_DATA_TYPE writeData;
21917  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
21918  </code>
21919  Remarks:
21920  None.
21921 */
21922 
21923 void
21924  SYS_PORTS_Write (
21925  PORTS_MODULE_ID index ,
21926  PORTS_CHANNEL channel ,
21927  PORTS_DATA_TYPE value ) ;
21928 // *****************************************************************************
21929 /* Function:
21930  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21931  Summary:
21932  Reads the data driven on the I/O port.
21933  <p><b>Implementation:</b> Dynamic</p>
21934  Description:
21935  This function reads the data driven on the I/O port.
21936  Preconditions:
21937  The direction of the port to be set as output.
21938  Parameters:
21939  index - Identifier for the device instance to be configured
21940  channel - Identifier for the PORT channel: A, B, C, etc.
21941  Returns:
21942  Returns the data driven on the port.
21943  Example:
21944  <code>
21945  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21946  // application developer.
21947  PORTS_DATA_TYPE drivenData;
21948  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
21949  </code>
21950  Remarks:
21951  None.
21952 */
21953 
21956  PORTS_MODULE_ID index ,
21957  PORTS_CHANNEL channel ) ;
21958 // *****************************************************************************
21959 /* Function:
21960  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21961  PORTS_DATA_TYPE value,
21962  PORTS_DATA_MASK mask )
21963  Summary:
21964  Sets the selected digital port/latch based on the mask.
21965  <p><b>Implementation:</b> Dynamic</p>
21966  Description:
21967  This function Sets the selected digital port/latch relative to the mask.
21968  This function "AND" value and mask parameters and then set the bits
21969  in the port channel that were set in the result of the ANDing operation.
21970  Preconditions:
21971  None.
21972  Parameters:
21973  index - Identifier for the device instance to be configured
21974  channel - Identifier for the PORT channel: A, B, C, etc.
21975  value - Consists of information about which port bit has to be set
21976  mask - Identifies the bits which could be intended for setting
21977  Returns:
21978  None.
21979  Example:
21980  <code>
21981  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21982  // application developer.
21983  // MY_VALUE - 0x1234
21984  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
21985  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
21986  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
21987  </code>
21988  Remarks:
21989  Not all features are available on all devices. Refer to the specific device
21990  data sheet for availability.
21991 */
21992 
21993 void
21994  SYS_PORTS_Set (
21995  PORTS_MODULE_ID index ,
21996  PORTS_CHANNEL channel ,
21997  PORTS_DATA_TYPE value ,
21998  PORTS_DATA_MASK mask ) ;
21999 // *****************************************************************************
22000 /* Function:
22001  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22002  PORTS_DATA_MASK clearMask )
22003  Summary:
22004  Clears the selected digital port.
22005  <p><b>Implementation:</b> Dynamic</p>
22006  Description:
22007  This function clears the selected digital port.
22008  Preconditions:
22009  None.
22010  Parameters:
22011  index - Identifier for the device instance to be configured
22012  channel - Identifier for the PORT channel: A, B, C, etc.
22013  clearMask - Identifies the bits to be cleared
22014  Returns:
22015  None.
22016  Example:
22017  <code>
22018  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22019  // application developer.
22020  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22021  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22022  </code>
22023  Remarks:
22024  Not all features are available on all devices. Refer to the specific device
22025  data sheet for availability.
22026 */
22027 
22028 void
22029  SYS_PORTS_Clear (
22030  PORTS_MODULE_ID index ,
22031  PORTS_CHANNEL channel ,
22032  PORTS_DATA_MASK clearMask ) ;
22033 // *****************************************************************************
22034 /* Function:
22035  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22036  SYS_PORTS_PIN_DIRECTION pinDir,
22037  PORTS_CHANNEL channel,
22038  PORTS_DATA_MASK mask )
22039  Summary:
22040  Enables the direction for the selected port.
22041  <p><b>Implementation:</b> Dynamic</p>
22042  Description:
22043  This function enables the direction for the selected port.
22044  Preconditions:
22045  None.
22046  Parameters:
22047  index - Identifier for the device instance to be configured
22048  pinDir - Pin direction
22049  channel - Identifier for the PORT channel: A, B, C, etc.
22050  mask - Mask for the direction of width PORTS_DATA_MASK
22051  Returns:
22052  None
22053  Example:
22054  <code>
22055  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22056  // application developer.
22057  SYS_PORTS_PIN_DIRECTION pinDir;
22058  pinDir = SYS_PORTS_DIRECTION_INPUT;
22059  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22060  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22061  </code>
22062  Remarks:
22063  None.
22064 */
22065 
22066 void
22068  PORTS_MODULE_ID index ,
22069  SYS_PORTS_PIN_DIRECTION pinDir ,
22070  PORTS_CHANNEL channel ,
22071  PORTS_DATA_MASK mask ) ;
22072 // *****************************************************************************
22073 /* Function:
22074  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22075  Summary:
22076  Reads the direction for the selected port.
22077  <p><b>Implementation:</b> Dynamic</p>
22078  Description:
22079  This function reads the direction for the selected port.
22080  Preconditions:
22081  None.
22082  Parameters:
22083  index - Identifier for the device instance to be configured
22084  channel - Identifier for the PORT channel: A, B, C, etc.
22085  Returns:
22086  Direction of the port.
22087  Example:
22088  <code>
22089  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22090  // application developer.
22091  PORTS_DATA_MASK value;
22092  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22093  </code>
22094  Remarks:
22095  None.
22096 */
22097 
22100  PORTS_MODULE_ID index ,
22101  PORTS_CHANNEL channel ) ;
22102 // *****************************************************************************
22103 /* Function:
22104  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22105  PORTS_DATA_MASK toggleMask )
22106  Summary:
22107  Toggles the selected digital port pins.
22108  <p><b>Implementation:</b> Dynamic</p>
22109  Description:
22110  This function toggles the selected digital port pins.
22111  Preconditions:
22112  None.
22113  Parameters:
22114  index - Identifier for the device instance to be configured
22115  channel - Identifier for the PORT channel: A, B, C, etc.
22116  toggleMask - Identifies the bits to be toggled
22117  Returns:
22118  None.
22119  Example:
22120  <code>
22121  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22122  // application developer.
22123  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22124  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22125  </code>
22126  Remarks:
22127  None.
22128 */
22129 
22130 void
22132  PORTS_MODULE_ID index ,
22133  PORTS_CHANNEL channel ,
22134  PORTS_DATA_MASK toggleMask ) ;
22135 // *****************************************************************************
22136 /* Function:
22137  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22138  PORTS_DATA_MASK mask )
22139  Summary:
22140  Enables the open-drain functionality for the selected port.
22141  <p><b>Implementation:</b> Dynamic</p>
22142  Description:
22143  This function enables the open-drain functionality for the selected port.
22144  Preconditions:
22145  None.
22146  Parameters:
22147  index - Identifier for the device instance to be configured
22148  channel - Identifier for the PORT channel: A, B, C, etc.
22149  mask - Mask of type PORTS_DATA_MASK
22150  Returns:
22151  None.
22152  Example:
22153  <code>
22154  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22155  // application developer.
22156  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22157  </code>
22158  Remarks:
22159  Not all features are available on all devices. Refer to the specific device
22160  data sheet for availability.
22161 */
22162 
22163 void
22165  PORTS_MODULE_ID index ,
22166  PORTS_CHANNEL channel ,
22167  PORTS_DATA_MASK mask ) ;
22168 // *****************************************************************************
22169 /* Function:
22170  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22171  PORTS_DATA_MASK mask )
22172  Summary:
22173  Disables the open-drain functionality for the selected port.
22174  <p><b>Implementation:</b> Dynamic</p>
22175  Description:
22176  This function disables the open-drain functionality for the selected port.
22177  Preconditions:
22178  None.
22179  Parameters:
22180  index - Identifier for the device instance to be configured
22181  channel - Identifier for the PORT channel: A, B, C, etc.
22182  mask - Mask of type PORTS_DATA_MASK
22183  Returns:
22184  None.
22185  Example:
22186  <code>
22187  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22188  // application developer.
22189  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22190  </code>
22191  Remarks:
22192  Not all features are available on all devices. Refer to the specific device
22193  data sheet for availability.
22194 */
22195 
22196 void
22198  PORTS_MODULE_ID index ,
22199  PORTS_CHANNEL channel ,
22200  PORTS_DATA_MASK mask ) ;
22201 // *****************************************************************************
22202 /* Function:
22203  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22204  (
22205  PORTS_MODULE_ID index,
22206  PORTS_CHANNEL channel
22207  )
22208  Summary:
22209  Reads the interrupt status from the I/O port.
22210  <p><b>Implementation:</b> Dynamic</p>
22211  Description:
22212  This function reads the interrupt status from the I/O port.
22213  Preconditions:
22214  The interrupts should have been configured.
22215  Parameters:
22216  index - Identifier for the device instance to be configured
22217  channel - Identifier for the PORT channel: A, B, C, etc.
22218  Returns:
22219  Returns the interrupt status of the port channel.
22220  Example:
22221  <code>
22222  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22223  // application developer.
22224  PORTS_DATA_TYPE channelStatus;
22225  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22226  </code>
22227  Remarks:
22228  None.
22229 */
22230 
22233  PORTS_MODULE_ID index ,
22234  PORTS_CHANNEL channel ) ;
22235 // *****************************************************************************
22236 // *****************************************************************************
22237 // Section: SYS PORT PINS REMAPING Routines
22238 // *****************************************************************************
22239 // *****************************************************************************
22240 // *****************************************************************************
22241 /* Function:
22242  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22243  PORTS_REMAP_INPUT_FUNCTION function,
22244  PORTS_REMAP_INPUT_PIN remapPin )
22245  Summary:
22246  Input/Output (I/O) function remapping.
22247  <p><b>Implementation:</b> Dynamic</p>
22248  Description:
22249  This function controls the I/O function remapping.
22250  Precondition:
22251  None.
22252  Parameters:
22253  index - Identifier for the device instance to be configured
22254  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22255  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22256  Returns:
22257  None.
22258  Example:
22259  <code>
22260  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22261  // application developer.
22262  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22263  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22264  </code>
22265  Remarks:
22266  This feature may not be available on all devices. Please refer to the
22267  specific device data sheet to determine availability or use
22268  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22269  this feature is available.
22270 */
22271 
22272 void
22274  PORTS_MODULE_ID index ,
22275  PORTS_REMAP_INPUT_FUNCTION function ,
22276  PORTS_REMAP_INPUT_PIN remapPin ) ;
22277 // *****************************************************************************
22278 /* Function:
22279  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22280  PORTS_REMAP_OUTPUT_FUNCTION function,
22281  PORTS_REMAP_OUTPUT_PIN remapPin )
22282  Summary:
22283  Input/Output (I/O) function remapping.
22284  <p><b>Implementation:</b> Dynamic</p>
22285  Description:
22286  This function controls the I/O function remapping.
22287  Precondition:
22288  None.
22289  Parameters:
22290  index - Identifier for the device instance to be configured
22291  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22292  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22293  Returns:
22294  None.
22295  Example:
22296  <code>
22297  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22298  // application developer.
22299  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22300  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22301  </code>
22302  Remarks:
22303  This feature may not be available on all devices. Please refer to the
22304  specific device data sheet to determine availability or use
22305  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22306  this feature is available.
22307 */
22308 
22309 void
22311  PORTS_MODULE_ID index ,
22312  PORTS_REMAP_OUTPUT_FUNCTION function ,
22313  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22314 // *****************************************************************************
22315 // *****************************************************************************
22316 // Section: SYS Change Notification Pins Routines
22317 // *****************************************************************************
22318 // *****************************************************************************
22319 // *****************************************************************************
22320 /* Function:
22321  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22322  Summary:
22323  Globally enables the change notification for the selected port.
22324  <p><b>Implementation:</b> Dynamic</p>
22325  Description:
22326  This function globally enables the change notification for the selected port.
22327  Preconditions:
22328  None.
22329  Parameters:
22330  None.
22331  Returns:
22332  None.
22333  Example:
22334  <code>
22335  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22336  // application developer.
22337  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22338  </code>
22339  Remarks:
22340  Not all features are available on all devices. Refer to the specific device
22341  data sheet for availability.
22342 */
22343 
22344 void
22346  PORTS_MODULE_ID index ) ;
22347 // *****************************************************************************
22348 /* Function:
22349  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22350  Summary:
22351  Globally disables the change notification for the selected port.
22352  <p><b>Implementation:</b> Dynamic</p>
22353  Description:
22354  This function globally disables the change notification for the selected port.
22355  Preconditions:
22356  None.
22357  Parameters:
22358  None.
22359  Returns:
22360  None.
22361  Example:
22362  <code>
22363  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22364  // application developer.
22365  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22366  </code>
22367  Remarks:
22368  Not all features are available on all devices. Refer to the specific device
22369  data sheet for availability.
22370 */
22371 
22372 void
22374  PORTS_MODULE_ID index ) ;
22375 // *****************************************************************************
22376 /* Function:
22377  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22378  PORTS_CHANGE_NOTICE_PIN pinNum,
22379  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22380  Summary:
22381  Enables the change notification for the selected port.
22382  <p><b>Implementation:</b> Dynamic</p>
22383  Description:
22384  This function enables the change notification for the selected port.
22385  Preconditions:
22386  None.
22387  Parameters:
22388  index - Identifier for the device instance to be configured
22389  value - Pull-up enable or disable value
22390  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22391  Returns:
22392  None.
22393  Example:
22394  <code>
22395  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22396  // application developer.
22397  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22398  PORTS_CHANGE_NOTICE_PIN pinNum;
22399  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22400  </code>
22401  Remarks:
22402  Not all features are available on all devices. Refer to the specific device
22403  data sheet for availability.
22404 */
22405 
22406 void
22408  PORTS_MODULE_ID index ,
22409  PORTS_CHANGE_NOTICE_PIN pinNum ,
22411 // *****************************************************************************
22412 /* Function:
22413  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22414  PORTS_CHANGE_NOTICE_PIN pinNum )
22415  Summary:
22416  Disables the change notification for the selected port.
22417  <p><b>Implementation:</b> Dynamic</p>
22418  Description:
22419  This function disables the change notification for the selected port.
22420  Preconditions:
22421  None.
22422  Parameters:
22423  index - Identifier for the device instance to be configured
22424  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22425  Returns:
22426  None.
22427  Example:
22428  <code>
22429  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22430  // application developer.
22431  PORTS_CHANGE_NOTICE_PIN pinNum;
22432  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22433  </code>
22434  Remarks:
22435  Not all features are available on all devices. Refer to the specific device
22436  data sheet for availability.
22437 */
22438 
22439 void
22441  PORTS_MODULE_ID index ,
22442  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22443 // *****************************************************************************
22444 /* Function:
22445  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22446  Summary:
22447  Enables the change notification for the selected port in Sleep or Idle mode.
22448  <p><b>Implementation:</b> Dynamic</p>
22449  Description:
22450  This function enables the change notification for the selected port in Sleep
22451  or Idle mode.
22452  Preconditions:
22453  None.
22454  Parameters:
22455  None.
22456  Returns:
22457  None.
22458  Example:
22459  <code>
22460  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22461  // application developer.
22462  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22463  </code>
22464  Remarks:
22465  Not all features are available on all devices. Refer to the specific device
22466  data sheet for availability.
22467 */
22468 
22469 void
22471  PORTS_MODULE_ID index ) ;
22472 // *****************************************************************************
22473 /* Function:
22474  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22475  Summary:
22476  Disables the change notification for the selected port in Sleep or Idle mode.
22477  <p><b>Implementation:</b> Dynamic</p>
22478  Description:
22479  This function disables the change notification for the selected port in Sleep
22480  or Idle mode.
22481  Preconditions:
22482  None.
22483  Parameters:
22484  None.
22485  Returns:
22486  None.
22487  Example:
22488  <code>
22489  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22490  // application developer.
22491  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22492  </code>
22493  Remarks:
22494  Not all features are available on all devices. Refer to the specific device
22495  data sheet for availability.
22496 */
22497 
22498 void
22500  PORTS_MODULE_ID index ) ;
22501 // *****************************************************************************
22502 /* Function:
22503  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22504  PORTS_CHANGE_NOTICE_PIN pinNum )
22505  Summary:
22506  Enables a weak pull-up on the change notification pin.
22507  <p><b>Implementation:</b> Dynamic</p>
22508  Description:
22509  This function enables a weak pull-up on the change notification pin.
22510  Preconditions:
22511  None.
22512  Parameters:
22513  index - Identifier for the device instance to be configured
22514  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22515  Returns:
22516  None.
22517  Example:
22518  <code>
22519  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22520  // application developer.
22521  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22522  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22523  </code>
22524  Remarks:
22525  Not all features are available on all devices. Refer to the specific device
22526  data sheet for availability.
22527 */
22528 
22529 void
22531  PORTS_MODULE_ID index ,
22532  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22533 // *****************************************************************************
22534 /* Function:
22535  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22536  PORTS_CHANGE_NOTICE_PIN pinNum )
22537  Summary:
22538  Disables a weak pull-up on the change notification pin.
22539  <p><b>Implementation:</b> Dynamic</p>
22540  Description:
22541  This function Disables a weak pull-up on the change notification pin.
22542  Preconditions:
22543  None.
22544  Parameters:
22545  index - Identifier for the device instance to be configured
22546  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22547  Returns:
22548  None.
22549  Example:
22550  <code>
22551  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22552  // application developer.
22553  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22554  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22555  </code>
22556  Remarks:
22557  Not all features are available on all devices. Refer to the specific device
22558  data sheet for availability.
22559 */
22560 
22561 void
22563  PORTS_MODULE_ID index ,
22564  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22565 // *****************************************************************************
22566 // *****************************************************************************
22567 // Section: SYS PORT PINS Control Routines
22568 // *****************************************************************************
22569 // *****************************************************************************
22570 // *****************************************************************************
22571 /* Function:
22572  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22573  PORTS_ANALOG_PIN pin,
22574  PORTS_PIN_MODE mode)
22575  Summary:
22576  Enables the selected pin as analog or digital.
22577  <p><b>Implementation:</b> Dynamic</p>
22578  Description:
22579  This function enables the selected pin as analog or digital.
22580  Preconditions:
22581  None.
22582  Parameters:
22583  index - Identifier for the device instance to be configured
22584  pin - Possible values of PORTS_ANALOG_PIN
22585  mode - Possible values of PORTS_PIN_MODE
22586  Returns:
22587  None.
22588  Example:
22589  <code>
22590  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22591  // application developer.
22592  // MY_PIN - PORTS_ANALOG_PIN_AN0
22593  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22594  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22595  </code>
22596  Remarks:
22597  Not all features are available on all devices. Refer to the specific device
22598  data sheet for availability.
22599 */
22600 
22601 void
22603  PORTS_MODULE_ID index ,
22604  PORTS_ANALOG_PIN pin ,
22605  PORTS_PIN_MODE mode ) ;
22606 // *****************************************************************************
22607 /* Function:
22608  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22609  PORTS_CHANNEL channel,
22610  PORTS_BIT_POS bitPos
22611  bool value )
22612  Summary:
22613  Writes the selected digital pin.
22614  <p><b>Implementation:</b> Dynamic</p>
22615  Description:
22616  This function writes the selected digital pin.
22617  Preconditions:
22618  None.
22619  Parameters:
22620  index - Identifier for the device instance to be configured
22621  channel - Identifier for the PORT channel: A, B, C, etc.
22622  bitPos - Possible values of PORTS_BIT_POS
22623  value - Value to be written to the specific pin/latch:
22624  - true - Sets the bit
22625  - false - Clears the bit
22626  Returns:
22627  None.
22628  Example:
22629  <code>
22630  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22631  // application developer.
22632  // MY_PINNUM - PORTS_PIN_10
22633  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22634  </code>
22635  Remarks:
22636  Not all features are available on all devices. Refer to the specific device
22637  data sheet for availability.
22638 */
22639 
22640 void
22642  PORTS_MODULE_ID index ,
22643  PORTS_CHANNEL channel ,
22644  PORTS_BIT_POS bitPos ,
22645  bool value ) ;
22646 // *****************************************************************************
22647 /* Function:
22648  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22649  PORTS_CHANNEL channel,
22650  PORTS_BIT_POS bitPos )
22651  Summary:
22652  Reads the data driven on the selected digital pin.
22653  <p><b>Implementation:</b> Dynamic</p>
22654  Description:
22655  This function reads the data driven on the selected
22656  digital output pin.
22657  Preconditions:
22658  None.
22659  Parameters:
22660  index - Identifier for the device instance to be configured
22661  channel - Identifier for the PORT channel: A, B, C, etc.
22662  bitPos - Possible values of PORTS_BIT_POS
22663  Returns:
22664  The status of the data driven on the port pin.
22665  Example:
22666  <code>
22667  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22668  // application developer.
22669  // MY_PINNUM - PORTS_PIN_10
22670  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22671  </code>
22672  Remarks:
22673  Not all features are available on all devices. Refer to the specific device
22674  data sheet for availability.
22675 */
22676 
22677 bool
22679  PORTS_MODULE_ID index ,
22680  PORTS_CHANNEL channel ,
22681  PORTS_BIT_POS bitPos ) ;
22682 // *****************************************************************************
22683 /* Function:
22684  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22685  PORTS_CHANNEL channel,
22686  PORTS_BIT_POS bitPos )
22687  Summary:
22688  Reads the selected digital pin.
22689  <p><b>Implementation:</b> Dynamic</p>
22690  Description:
22691  This function reads the selected digital pin, not the Latch.
22692  Preconditions:
22693  None.
22694  Parameters:
22695  index - Identifier for the device instance to be configured
22696  channel - Identifier for the PORT channel: A, B, C, etc.
22697  bitPos - Possible values of PORTS_BIT_POS
22698  Returns:
22699  The status of the port pin.
22700  Example:
22701  <code>
22702  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22703  // application developer.
22704  // MY_PINNUM - PORTS_PIN_10
22705  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22706  </code>
22707  Remarks:
22708  Not all features are available on all devices. Refer to the specific device
22709  data sheet for availability.
22710 */
22711 
22712 bool
22714  PORTS_MODULE_ID index ,
22715  PORTS_CHANNEL channel ,
22716  PORTS_BIT_POS bitPos ) ;
22717 // *****************************************************************************
22718 /* Function:
22719  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22720  PORTS_CHANNEL channel,
22721  PORTS_BIT_POS bitPos )
22722  Summary:
22723  Toggles the selected digital pin.
22724  <p><b>Implementation:</b> Dynamic</p>
22725  Description:
22726  This function toggles the selected digital pin.
22727  Preconditions:
22728  None.
22729  Parameters:
22730  index - Identifier for the device instance to be configured
22731  channel - Identifier for the PORT channel: A, B, C, etc.
22732  bitPos - Possible values of PORTS_BIT_POS
22733  Returns:
22734  None.
22735  Example:
22736  <code>
22737  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22738  // application developer.
22739  // MY_PINNUM - PORTS_PIN_10
22740  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22741  </code>
22742  Remarks:
22743  Not all features are available on all devices. Refer to the specific device
22744  data sheet for availability.
22745 */
22746 
22747 void
22749  PORTS_MODULE_ID index ,
22750  PORTS_CHANNEL channel ,
22751  PORTS_BIT_POS bitPos ) ;
22752 // *****************************************************************************
22753 /* Function:
22754  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22755  PORTS_CHANNEL channel,
22756  PORTS_BIT_POS bitPos )
22757  Summary:
22758  Sets the selected digital pin/latch.
22759  <p><b>Implementation:</b> Dynamic</p>
22760  Description:
22761  This function sets the selected digital pin/latch.
22762  Preconditions:
22763  None.
22764  Parameters:
22765  index - Identifier for the device instance to be configured
22766  channel - Identifier for the PORT channel: A, B, C, etc.
22767  bitPos - Possible values of PORTS_BIT_POS
22768  Returns:
22769  None.
22770  Example:
22771  <code>
22772  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22773  // application developer.
22774  // MY_PINNUM - PORTS_PIN_10
22775  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22776  </code>
22777  Remarks:
22778  Not all features are available on all devices. Refer to the specific device
22779  data sheet for availability.
22780 */
22781 
22782 void
22784  PORTS_MODULE_ID index ,
22785  PORTS_CHANNEL channel ,
22786  PORTS_BIT_POS bitPos ) ;
22787 // *****************************************************************************
22788 /* Function:
22789  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22790  PORTS_CHANNEL channel,
22791  PORTS_BIT_POS bitPos )
22792  Summary:
22793  Clears the selected digital pin.
22794  <p><b>Implementation:</b> Dynamic</p>
22795  Description:
22796  This function clears the selected digital pin.
22797  Preconditions:
22798  None.
22799  Parameters:
22800  index - Identifier for the device instance to be configured
22801  channel - Identifier for the PORT channel: A, B, C, etc.
22802  bitPos - Possible values of PORTS_BIT_POS
22803  Returns:
22804  None.
22805  Example:
22806  <code>
22807  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22808  // application developer.
22809  // MY_PINNUM - PORTS_IO_PIN_10
22810  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22811  </code>
22812  Remarks:
22813  Not all features are available on all devices. Refer to the specific device
22814  data sheet for availability.
22815 */
22816 
22817 void
22819  PORTS_MODULE_ID index ,
22820  PORTS_CHANNEL channel ,
22821  PORTS_BIT_POS bitPos ) ;
22822 // *****************************************************************************
22823 /* Function:
22824  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22825  SYS_PORTS_PIN_DIRECTION pinDir,
22826  PORTS_CHANNEL channel,
22827  PORTS_BIT_POS bitPos )
22828  Summary:
22829  Enables the direction for the selected pin.
22830  <p><b>Implementation:</b> Dynamic</p>
22831  Description:
22832  This function enables the direction for the selected pin.
22833  Preconditions:
22834  None.
22835  Parameters:
22836  index - Identifier for the device instance to be configured
22837  pinDir - Pin direction
22838  channel - Identifier for the PORT channel: A, B, C, etc.
22839  bitPos - Possible values of PORTS_BIT_POS
22840  Returns:
22841  None.
22842  Example:
22843  <code>
22844  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22845  // application developer.
22846  // MY_PINNUM - PORTS_PIN_10
22847  SYS_PORTS_PIN_DIRECTION pinDir;
22848  pinDir = SYS_PORTS_DIRECTION_INPUT;
22849  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22850  </code>
22851  Remarks:
22852  Not all features are available on all devices. Refer to the specific device
22853  data sheet for availability.
22854 */
22855 
22856 void
22858  PORTS_MODULE_ID index ,
22859  SYS_PORTS_PIN_DIRECTION pinDir ,
22860  PORTS_CHANNEL channel ,
22861  PORTS_BIT_POS bitPos ) ;
22862 // *****************************************************************************
22863 /* Function:
22864  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22865  PORTS_CHANNEL channel,
22866  PORTS_BIT_POS bitPos )
22867  Summary:
22868  Enables the open-drain functionality for the selected pin.
22869  <p><b>Implementation:</b> Dynamic</p>
22870  Description:
22871  This function enables the open-drain functionality for the selected pin.
22872  Preconditions:
22873  None.
22874  Parameters:
22875  index - Identifier for the device instance to be configured
22876  channel - Identifier for the PORT channel: A, B, C, etc.
22877  bitPos - Possible values of PORTS_BIT_POS
22878  Returns:
22879  None.
22880  Example:
22881  <code>
22882  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22883  // application developer.
22884  // MY_PINNUM - PORTS_PIN_10
22885  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22886  </code>
22887  Remarks:
22888  Not all features are available on all devices. Refer to the specific device
22889  data sheet for availability.
22890 */
22891 
22892 void
22894  PORTS_MODULE_ID index ,
22895  PORTS_CHANNEL channel ,
22896  PORTS_BIT_POS bitPos ) ;
22897 // *****************************************************************************
22898 /* Function:
22899  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22900  PORTS_CHANNEL channel,
22901  PORTS_BIT_POS bitPos )
22902  Summary:
22903  Disables the open-drain functionality for the selected pin.
22904  <p><b>Implementation:</b> Dynamic</p>
22905  Description:
22906  This function disables the open-drain functionality for the selected pin.
22907  Preconditions:
22908  None.
22909  Parameters:
22910  index - Identifier for the device instance to be configured
22911  channel - Identifier for the PORT channel: A, B, C, etc.
22912  bitPos - Possible values of PORTS_BIT_POS
22913  Returns:
22914  None.
22915  Example:
22916  <code>
22917  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22918  // application developer.
22919  // MY_PINNUM - PORTS_PIN_10
22920  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22921  </code>
22922  Remarks:
22923  Not all features are available on all devices. Refer to the specific device
22924  data sheet for availability.
22925 */
22926 
22927 void
22929  PORTS_MODULE_ID index ,
22930  PORTS_CHANNEL channel ,
22931  PORTS_BIT_POS bitPos ) ;
22932 // *****************************************************************************
22933 /* Function:
22934  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
22935  PORTS_CHANNEL channel,
22936  PORTS_BIT_POS bitPos )
22937  Summary:
22938  Enables the pull-up functionality for the selected pin.
22939  <p><b>Implementation:</b> Dynamic</p>
22940  Description:
22941  This function enables the pull-up functionality for the selected pin.
22942  Preconditions:
22943  None.
22944  Parameters:
22945  index - Identifier for the device instance to be configured
22946  channel - Identifier for the PORT channel: A, B, C, etc.
22947  bitPos - Possible values of PORTS_BIT_POS
22948  Returns:
22949  None.
22950  Example:
22951  <code>
22952  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22953  // application developer.
22954  // MY_PINNUM - PORTS_PIN_10
22955  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22956  </code>
22957  Remarks:
22958  Not all features are available on all devices. Refer to the specific device
22959  data sheet for availability.
22960 */
22961 
22962 void
22964  PORTS_MODULE_ID index ,
22965  PORTS_CHANNEL channel ,
22966  PORTS_BIT_POS bitPos ) ;
22967 // *****************************************************************************
22968 /* Function:
22969  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
22970  PORTS_CHANNEL channel,
22971  PORTS_BIT_POS bitPos )
22972  Summary:
22973  Disables the pull-up functionality for the selected pin.
22974  <p><b>Implementation:</b> Dynamic</p>
22975  Description:
22976  This function disables the pull-up functionality for the selected pin.
22977  Preconditions:
22978  None.
22979  Parameters:
22980  index - Identifier for the device instance to be configured
22981  channel - Identifier for the PORT channel: A, B, C, etc.
22982  bitPos - Possible values of PORTS_BIT_POS
22983  Returns:
22984  None.
22985  Example:
22986  <code>
22987  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22988  // application developer.
22989  // MY_PINNUM - PORTS_PIN_10
22990  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22991  </code>
22992  Remarks:
22993  Not all features are available on all devices. Refer to the specific device
22994  data sheet for availability.
22995 */
22996 
22997 void
22999  PORTS_MODULE_ID index ,
23000  PORTS_CHANNEL channel ,
23001  PORTS_BIT_POS bitPos ) ;
23002 // *****************************************************************************
23003 /* Function:
23004  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23005  PORTS_CHANNEL channel,
23006  PORTS_BIT_POS bitPos )
23007  Summary:
23008  Enables the pull-down functionality for the selected pin.
23009  <p><b>Implementation:</b> Dynamic</p>
23010  Description:
23011  This function enables the pull-down functionality for the selected pin.
23012  Preconditions:
23013  None.
23014  Parameters:
23015  index - Identifier for the device instance to be configured
23016  channel - Identifier for the PORT channel: A, B, C, etc.
23017  bitPos - Possible values of PORTS_BIT_POS
23018  Returns:
23019  None.
23020  Example:
23021  <code>
23022  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23023  // application developer.
23024  // MY_PINNUM - PORTS_PIN_10
23025  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23026  </code>
23027  Remarks:
23028  Not all features are available on all devices. Refer to the specific device
23029  data sheet for availability.
23030 */
23031 
23032 void
23034  PORTS_MODULE_ID index ,
23035  PORTS_CHANNEL channel ,
23036  PORTS_BIT_POS bitPos ) ;
23037 // *****************************************************************************
23038 /* Function:
23039  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23040  PORTS_CHANNEL channel,
23041  PORTS_BIT_POS bitPos )
23042  Summary:
23043  Disables the pull-down functionality for the selected pin.
23044  <p><b>Implementation:</b> Dynamic</p>
23045  Description:
23046  This function disables the pull-down functionality for the selected pin.
23047  Preconditions:
23048  None.
23049  Parameters:
23050  index - Identifier for the device instance to be configured
23051  channel - Identifier for the PORT channel: A, B, C, etc.
23052  bitPos - Possible values of PORTS_BIT_POS
23053  Returns:
23054  None.
23055  Example:
23056  <code>
23057  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23058  // application developer.
23059  // MY_PINNUM - PORTS_PIN_10
23060  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23061  </code>
23062  Remarks:
23063  Not all features are available on all devices. Refer to the specific device
23064  data sheet for availability.
23065 */
23066 
23067 void
23069  PORTS_MODULE_ID index ,
23070  PORTS_CHANNEL channel ,
23071  PORTS_BIT_POS bitPos ) ;
23072 //******************************************************************************
23073 /* Function:
23074  void SYS_PORTS_InterruptEnable
23075  (
23076  PORTS_MODULE_ID index,
23077  PORTS_CHANNEL channel,
23078  PORTS_BIT_POS bitPos,
23079  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23080  )
23081  Summary:
23082  Enables the selected interrupt for the selected port pin.
23083  Description:
23084  This function enables the selected interrupt for the selected port pin.
23085  Preconditions:
23086  Select the pull-up or pull-down as required.
23087  Parameters:
23088  index - Identifier for the device instance to be configured
23089  channel - Identifier for the PORT channel: A, B, C, etc.
23090  bitPos - Possible values of PORTS_BIT_POS
23091  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23092  Returns:
23093  None.
23094  Example:
23095  <code>
23096  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23097  </code>
23098  Remarks:
23099  None.
23100 */
23101 
23102 void
23104  PORTS_MODULE_ID index ,
23105  PORTS_CHANNEL channel ,
23106  PORTS_BIT_POS bitPos ,
23107  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23108 //DOM-IGNORE-BEGIN
23109 //DOM-IGNORE-END
23110  //SYS_PORTS_H
23111 /*******************************************************************************
23112  End of File
23113 */
23114 
23115 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23116 /* CLOSE_FILE Include File */
23117 
23118 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23119 /*******************************************************************************
23120  SPI Driver Interface
23121  Company:
23122  Microchip Technology Inc.
23123  File Name:
23124  drv_spi.h
23125  Summary:
23126  SPI device driver interface file.
23127  Description:
23128  The SPI driver provides a simple interface to manage the SPI module.
23129  This file defines the interface definitions and prototypes for the SPI driver.
23130 *******************************************************************************/
23131 //DOM-IGNORE-BEGIN
23132 /*******************************************************************************
23133 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23134 Microchip licenses to you the right to use, modify, copy and distribute
23135 Software only when embedded on a Microchip microcontroller or digital signal
23136 controller that is integrated into your product or third party product
23137 (pursuant to the sublicense terms in the accompanying license agreement).
23138 You should refer to the license agreement accompanying this Software for
23139 additional information regarding your rights and obligations.
23140 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23141 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23142 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23143 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23144 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23145 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23146 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23147 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23148 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23149 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23150 *******************************************************************************/
23151 //DOM-IGNORE-END
23152 #ifndef _DRV_SPI_H
23153 #define _DRV_SPI_H
23154 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23155 /*******************************************************************************
23156  SPI Driver Interface
23157  Company:
23158  Microchip Technology Inc.
23159  File Name:
23160  drv_spi_definitions.h
23161  Summary:
23162  SPI device driver interface file.
23163  Description:
23164  The SPI driver provides a simple interface to manage the SPI module.
23165  This file defines the interface definitions and prototypes for the SPI
23166  driver.
23167 *******************************************************************************/
23168 //DOM-IGNORE-BEGIN
23169 /*******************************************************************************
23170 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23171 Microchip licenses to you the right to use, modify, copy and distribute
23172 Software only when embedded on a Microchip microcontroller or digital signal
23173 controller that is integrated into your product or third party product
23174 (pursuant to the sublicense terms in the accompanying license agreement).
23175 You should refer to the license agreement accompanying this Software for
23176 additional information regarding your rights and obligations.
23177 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23178 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23179 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23180 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23181 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23182 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23183 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23184 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23185 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23186 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23187 *******************************************************************************/
23188 //DOM-IGNORE-END
23189 #ifndef _DRV_SPI_DEFINITIONS_H
23190 #define _DRV_SPI_DEFINITIONS_H
23191 // *****************************************************************************
23192 // *****************************************************************************
23193 // Section: Data Types
23194 // *****************************************************************************
23195 // *****************************************************************************
23196 #include <stdint.h>
23197 #include <stdbool.h>
23198 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23199 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23200 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23201 /*******************************************************************************
23202  SPI Peripheral Library Interface Header
23203  Company:
23204  Microchip Technology Inc.
23205  File Name:
23206  plib_spi.h
23207  Summary:
23208  SPI Peripheral Library Interface Header for common definitions.
23209  Description:
23210  This header file contains the function prototypes and definitions of
23211  the data types and constants that make up the interface to the SPI
23212  PLIB.
23213  *******************************************************************************/
23214 // DOM-IGNORE-BEGIN
23215 /*******************************************************************************
23216 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23217 Microchip licenses to you the right to use, modify, copy and distribute
23218 Software only when embedded on a Microchip microcontroller or digital signal
23219 controller that is integrated into your product or third party product
23220 (pursuant to the sublicense terms in the accompanying license agreement).
23221 You should refer to the license agreement accompanying this Software for
23222 additional information regarding your rights and obligations.
23223 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23224 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23225 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23226 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23227 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23228 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23229 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23230 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23231 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23232 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23233  *******************************************************************************/
23234 // DOM-IGNORE-END
23235 #ifndef _PLIB_SPI_H
23236 #define _PLIB_SPI_H
23237 // DOM-IGNORE-BEGIN
23238 // DOM-IGNORE-END
23239 // *****************************************************************************
23240 // *****************************************************************************
23241 // Section: Included Files (continued at end of file)
23242 // *****************************************************************************
23243 // *****************************************************************************
23244 /* This section lists the other files that are included in this file. However,
23245  please see the end of the file for additional implementation header files
23246  that are also included.
23247  */
23248 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23249 //DOM-IGNORE-BEGIN
23250 /*******************************************************************************
23251 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23252 Microchip licenses to you the right to use, modify, copy and distribute
23253 Software only when embedded on a Microchip microcontroller or digital signal
23254 controller that is integrated into your product or third party product
23255 (pursuant to the sublicense terms in the accompanying license agreement).
23256 You should refer to the license agreement accompanying this Software for
23257 additional information regarding your rights and obligations.
23258 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23259 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23260 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23261 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23262 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23263 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23264 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23265 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23266 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23267 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23268  *******************************************************************************/
23269 //DOM-IGNORE-END
23270 #ifndef _PLIB_SPI_PROCESSOR_H
23271 #define _PLIB_SPI_PROCESSOR_H
23272 #error "Can't find header"
23273 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23274 /* CLOSE_FILE Include File */
23275 
23276 // *****************************************************************************
23277 // *****************************************************************************
23278 // Section: Constants & Data Types
23279 // *****************************************************************************
23280 // *****************************************************************************
23281 // *****************************************************************************
23282 // *****************************************************************************
23283 // Section: SPI Peripheral Library Interface Routines
23284 // *****************************************************************************
23285 // *****************************************************************************
23286 //******************************************************************************
23287 /* Function:
23288  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23289  Summary:
23290  Enables the SPI module.
23291  Description:
23292  This function enables the SPI module.
23293  This operation is atomic.
23294  Precondition:
23295  None.
23296  Parameters:
23297  index - Identifier for the device instance to be configured
23298  Returns:
23299  None.
23300  Example:
23301  <code>
23302  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23303  // application developer.
23304  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23305  </code>
23306  Remarks:
23307  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23308  before use.
23309  This function implements an operation of the enable control feature. This
23310  feature may not be available on all devices. Please refer to the specific
23311  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23312  in your application to automatically determine whether this feature is available.
23313  */
23314 
23315 void
23316  PLIB_SPI_Enable (
23317  SPI_MODULE_ID index ) ;
23318 //******************************************************************************
23319 /* Function:
23320  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23321  Summary:
23322  Disables the SPI module.
23323  Description:
23324  This function disables the SPI module.
23325  This operation is atomic.
23326  Precondition:
23327  None.
23328  Parameters:
23329  index - Identifier for the device instance to be configured
23330  Returns:
23331  None.
23332  Example:
23333  <code>
23334  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23335  // application developer.
23336  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23337  </code>
23338  Remarks:
23339  This function implements an operation of the enable control feature. This
23340  feature may not be available on all devices. Please refer to the specific
23341  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23342  in your application to automatically determine whether this feature is available.
23343  */
23344 
23345 void
23347  SPI_MODULE_ID index ) ;
23348 //******************************************************************************
23349 /* Function:
23350  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23351  Summary:
23352  Discontinues module operation when the device enters Idle mode.
23353  Description:
23354  This function sets up the SPI module such that module operation is disabled
23355  when the device enters Idle mode.
23356  This operation is atomic.
23357  Precondition:
23358  None.
23359  Parameters:
23360  index - Identifier for the device instance to be configured
23361  Returns:
23362  None.
23363  Example:
23364  <code>
23365  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23366  // application developer.
23367  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23368  </code>
23369  Remarks:
23370  This function implements an operation of the stop in idle control feature.
23371  This feature may not be available on all devices. Please refer to the
23372  specific device data sheet to determine availability or use
23373  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23374  determine if this feature is available.
23375  */
23376 
23377 void
23379  SPI_MODULE_ID index ) ;
23380 //******************************************************************************
23381 /* Function:
23382  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23383  Summary:
23384  Continues module operation when the device enters Idle mode.
23385  Description:
23386  This function sets up the SPI module such that module operation is continued
23387  when the device enters Idle mode.
23388  This operation is atomic.
23389  Precondition:
23390  None.
23391  Parameters:
23392  index - Identifier for the device instance to be configured
23393  Returns:
23394  None.
23395  Example:
23396  <code>
23397  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23398  // application developer.
23399  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23400  </code>
23401  Remarks:
23402  This function implements an operation of the stop in idle control feature.
23403  This feature may not be available on all devices. Please refer to the
23404  specific device data sheet to determine availability or use
23405  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23406  this feature is available.
23407  */
23408 
23409 void
23411  SPI_MODULE_ID index ) ;
23412 //******************************************************************************
23413 /* Function:
23414  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23415  Summary:
23416  Returns the current status of the SPI receiver overflow.
23417  Description:
23418  This function returns the current status of the SPI receiver overflow.
23419  This operation is atomic.
23420  Precondition:
23421  None.
23422  Parameters:
23423  index - Identifier for the device instance to be configured
23424  Returns:
23425  SPI receiver overflow status:
23426  - true - A new byte/word is completely received and discarded.
23427  The user software has not read the previous data in
23428  the SPI buffer register.
23429  - false - No Overflow has occurred
23430  Example:
23431  <code>
23432  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23433  // application developer.
23434  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23435  </code>
23436  Remarks:
23437  This function implements an operation of the receiver overflow status feature.
23438  This feature may not be available on all devices. Please refer to the
23439  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23440  in your application to automatically determine whether this feature is available.
23441  */
23442 
23443 bool
23445  SPI_MODULE_ID index ) ;
23446 //******************************************************************************
23447 /* Function:
23448  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23449  Summary:
23450  Clears the SPI receive overflow flag.
23451  Description:
23452  This function clears the SPI receive overflow flag.
23453  This operation is atomic.
23454  Precondition:
23455  None.
23456  Parameters:
23457  index - Identifier for the device instance to be configured
23458  Returns:
23459  None.
23460  Example:
23461  <code>
23462  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23463  // application developer.
23464  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23465  </code>
23466  Remarks:
23467  This function implements an operation of the receiver overflow status feature.
23468  This feature may not be available on all devices. Please refer to the
23469  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23470  in your application to automatically determine whether this feature is available.
23471  */
23472 
23473 void
23475  SPI_MODULE_ID index ) ;
23476 //******************************************************************************
23477 /* Function:
23478  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23479  Summary:
23480  Returns the current transmit buffer status of the SPI module.
23481  Description:
23482  This function returns the current transmit buffer status of the SPI module.
23483  This operation is atomic.
23484  Precondition:
23485  None.
23486  Parameters:
23487  index - Identifier for the device instance to be configured
23488  Returns:
23489  - true - Transmit not yet started, transmit buffer is full
23490  - false - Transmit started, transmit buffer is empty/not full
23491  Example:
23492  <code>
23493  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23494  // application developer.
23495  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23496  </code>
23497  Remarks:
23498  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23499  occur, loading the transmit buffer. Automatically cleared in hardware when
23500  the SPI module transfers data from the transmit buffer to the shift register.
23501  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23502  occur, loading the last available buffer. Automatically cleared in hardware
23503  when the buffer is available for writing.
23504  This function implements an operation of the transmit buffer status feature.
23505  This feature may not be available on all devices. Please refer to the
23506  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23507  in your application to automatically determine whether this feature is available.
23508  */
23509 
23510 bool
23512  SPI_MODULE_ID index ) ;
23513 //******************************************************************************
23514 /* Function:
23515  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23516  Summary:
23517  Returns the current status of the SPI receive buffer.
23518  Description:
23519  This function returns the current status of the SPI receive buffer.
23520  This operation is atomic.
23521  Precondition:
23522  None.
23523  Parameters:
23524  index - Identifier for the device instance to be configured
23525  Returns:
23526  Receiver Buffer Full Status:
23527  - true - Receive complete, receive buffer is full
23528  - false - Receive is not complete, receive buffer is empty
23529  Example:
23530  <code>
23531  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23532  // application developer.
23533  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23534  </code>
23535  Remarks:
23536  In Standard Buffer mode - automatically set in hardware when the SPI module
23537  transfers data from the shift register to the receive buffer. Automatically
23538  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23539  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23540  transfers data from the shift register to the receive buffer, filling the
23541  last unread buffer. Automatically cleared in hardware when a buffer is available
23542  for a transfer from the shift register.
23543  This function implements an operation of the receiver buffer status feature.
23544  This feature may not be available on all devices. Please refer to the
23545  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23546  in your application to automatically determine whether this feature is available.
23547  */
23548 
23549 bool
23551  SPI_MODULE_ID index ) ;
23552 //******************************************************************************
23553 /* Function:
23554  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23555  Summary:
23556  Enables the selected SPI pins.
23557  Description:
23558  This function enables the selected SPI pins.
23559  Precondition:
23560  None.
23561  Parameters:
23562  index - Identifier for the device instance to be configured
23563  pin - One of the SPI_PIN enumeration values as the SPI pin
23564  Returns:
23565  None.
23566  Example:
23567  <code>
23568  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23569  // application developer.
23570  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23571  </code>
23572  Remarks:
23573  This function implements an operation of the pin control feature.
23574  This feature may not be available on all devices. Please refer to the
23575  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23576  in your application to automatically determine whether this feature is available.
23577  */
23578 
23579 void
23581  SPI_MODULE_ID index ,
23582  SPI_PIN pin ) ;
23583 //******************************************************************************
23584 /* Function:
23585  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23586  Summary:
23587  Enables the selected SPI pins.
23588  Description:
23589  This function enables the selected SPI pins.
23590  Precondition:
23591  None.
23592  Parameters:
23593  index - Identifier for the device instance to be configured
23594  pin - One of the SPI_PIN enumeration values as the SPI pin
23595  Returns:
23596  None.
23597  Example:
23598  <code>
23599  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23600  // application developer.
23601  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23602  </code>
23603  Remarks:
23604  This function implements an operation of the pin control feature.
23605  This feature may not be available on all devices. Please refer to the
23606  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23607  in your application to automatically determine whether this feature is available.
23608  */
23609 
23610 void
23612  SPI_MODULE_ID index ,
23613  SPI_PIN pin ) ;
23614 //******************************************************************************
23615 /* Function:
23616  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23617  SPI_COMMUNICATION_WIDTH width )
23618  Summary:
23619  Selects the data width for the SPI communication.
23620  Description:
23621  This function selects the data width for the SPI communication.
23622  This operation is atomic.
23623  Precondition:
23624  None.
23625  Parameters:
23626  index - Identifier for the device instance to be configured
23627  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23628  SPI buffer width
23629  Returns:
23630  None.
23631  Example:
23632  <code>
23633  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23634  // application developer.
23635  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23636  </code>
23637  Remarks:
23638  This function implements an operation of the communication width feature.
23639  This feature may not be available on all devices. Please refer to the
23640  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23641  in your application to automatically determine whether this feature is available.
23642  */
23643 
23644 void
23646  SPI_MODULE_ID index ,
23647  SPI_COMMUNICATION_WIDTH width ) ;
23648 //******************************************************************************
23649 /* Function:
23650  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23651  SPI_AUDIO_COMMUNICATION_WIDTH width )
23652  Summary:
23653  Selects the data width for the SPI audio communication.
23654  Description:
23655  This function selects the data width for the SPI audio communication.
23656  This operation is atomic.
23657  Precondition:
23658  None.
23659  Parameters:
23660  index - Identifier for the device instance to be configured
23661  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23662  SPI buffer width
23663  Returns:
23664  None.
23665  Example:
23666  <code>
23667  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23668  // application developer.
23669  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23670  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23671  </code>
23672  Remarks:
23673  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23674  This function implements an operation of the audio communication width feature.
23675  This feature may not be available on all devices. Please refer to the
23676  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23677  in your application to automatically determine whether this feature is available.
23678  */
23679 
23680 void
23682  SPI_MODULE_ID index ,
23683  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23684 //******************************************************************************
23685 /* Function:
23686  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23687  SPI_INPUT_SAMPLING_PHASE phase)
23688  Summary:
23689  Selects the SPI data input sample phase.
23690  Description:
23691  This function selects the input sampling phase in Master mode.
23692  Precondition:
23693  None.
23694  Parameters:
23695  index - Identifier for the device instance to be configured
23696  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23697  sampling phase
23698  Returns:
23699  None.
23700  Example:
23701  <code>
23702  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23703  // application developer.
23704  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23705  </code>
23706  Remarks:
23707  This function implements an operation of the input sample phase feature.
23708  This feature may not be available on all devices. Please refer to the
23709  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23710  in your application to automatically determine whether this feature is available.
23711  */
23712 
23713 void
23715  SPI_MODULE_ID index ,
23716  SPI_INPUT_SAMPLING_PHASE phase ) ;
23717 //******************************************************************************
23718 /* Function:
23719  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23720  SPI_OUTPUT_DATA_PHASE data)
23721  Summary:
23722  Selects serial output data change.
23723  Description:
23724  This function selects serial output data change.
23725  Precondition:
23726  None.
23727  Parameters:
23728  index - Identifier for the device instance to be configured
23729  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23730  SPI serial output data change
23731  Returns:
23732  None.
23733  Example:
23734  <code>
23735  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23736  // application developer.
23737  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23738  </code>
23739  Remarks:
23740  This function implements an operation of the output data phase feature.
23741  This feature may not be available on all devices. Please refer to the
23742  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23743  in your application to automatically determine whether this feature is available.
23744  */
23745 
23746 void
23748  SPI_MODULE_ID index ,
23749  SPI_OUTPUT_DATA_PHASE phase ) ;
23750 //******************************************************************************
23751 /* Function:
23752  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23753  SPI_CLOCK_POLARITY polarity)
23754  Summary:
23755  Enables clock polarity.
23756  Description:
23757  This function enables clock polarity.
23758  Precondition:
23759  None.
23760  Parameters:
23761  index - Identifier for the device instance to be configured
23762  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23763  Returns:
23764  None.
23765  Example:
23766  <code>
23767  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23768  // application developer.
23769  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23770  </code>
23771  Remarks:
23772  This function implements an operation of the clock polarity feature.
23773  This feature may not be available on all devices. Please refer to the
23774  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23775  in your application to automatically determine whether this feature is available.
23776  */
23777 
23778 void
23780  SPI_MODULE_ID index ,
23781  SPI_CLOCK_POLARITY polarity ) ;
23782 //******************************************************************************
23783 /* Function:
23784  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23785  Summary:
23786  Enables the SPI in Master mode.
23787  Description:
23788  This function enables the SPI in Master mode.
23789  This operation is atomic.
23790  Precondition:
23791  None.
23792  Parameters:
23793  index - Identifier for the device instance to be configured
23794  Returns:
23795  None.
23796  Example:
23797  <code>
23798  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23799  // application developer.
23800  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23801  </code>
23802  Remarks:
23803  This function implements an operation of the master enable control feature.
23804  This feature may not be available on all devices. Please refer to the
23805  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23806  in your application to automatically determine whether this feature is available.
23807  */
23808 
23809 void
23811  SPI_MODULE_ID index ) ;
23812 //******************************************************************************
23813 /* Function:
23814  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23815  Summary:
23816  Enables the SPI in Slave mode.
23817  Description:
23818  This function enables the SPI in Slave mode.
23819  This operation is atomic.
23820  Precondition:
23821  None.
23822  Parameters:
23823  index - Identifier for the device instance to be configured
23824  Returns:
23825  None.
23826  Example:
23827  <code>
23828  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23829  // application developer.
23830  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23831  </code>
23832  Remarks:
23833  This function implements an operation of the master enable control feature.
23834  This feature may not be available on all devices. Please refer to the
23835  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23836  in your application to automatically determine whether this feature is available.
23837  */
23838 
23839 void
23841  SPI_MODULE_ID index ) ;
23842 //******************************************************************************
23843 /* Function:
23844  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23845  uint32_t baudRate )
23846  Summary:
23847  Sets the baud rate to the desired value.
23848  Description:
23849  This function sets the baud rate to the desired value.
23850  Precondition:
23851  None.
23852  Parameters:
23853  index - Identifier for the device instance to be configured
23854  clockFrequency - Clock frequency
23855  baudrate - Baud rate value
23856  Returns:
23857  None.
23858  Example:
23859  <code>
23860  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23861  // application developer.
23862  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23863  </code>
23864  Remarks:
23865  Setting a new baud rate value causes the baud rate timer to reset.
23866  This ensures that the baud rate timer does not have to overflow before
23867  outputting the new baud rate.
23868  If the system clock is changed during an active receive operation, a
23869  receive error or data loss may result. To avoid this issue, verify that
23870  no receptions are in progress before changing the system clock.
23871  This function implements an operation of the baud rate set feature.
23872  This feature may not be available on all devices. Please refer to the
23873  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23874  in your application to automatically determine whether this feature is available.
23875  */
23876 
23877 void
23879  SPI_MODULE_ID index ,
23880  uint32_t clockFrequency ,
23881  uint32_t baudRate ) ;
23882 //******************************************************************************
23883 /* Function:
23884  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23885  Summary:
23886  Returns the current SPI module activity status.
23887  Description:
23888  This function returns the current SPI module activity status.
23889  This operation is atomic.
23890  Precondition:
23891  None.
23892  Parameters:
23893  index - Identifier for the device instance to be configured
23894  Returns:
23895  - true - SPI module is currently busy with some transactions
23896  - false - SPI module is currently idle
23897  Example:
23898  <code>
23899  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23900  // application developer.
23901  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23902  </code>
23903  Remarks:
23904  This function implements an operation of the bus status feature.
23905  This feature may not be available on all devices. Please refer to the
23906  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23907  in your application to automatically determine whether this feature is available.
23908  */
23909 
23910 bool
23911  PLIB_SPI_IsBusy (
23912  SPI_MODULE_ID index ) ;
23913 //******************************************************************************
23914 /* Function:
23915  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
23916  Summary:
23917  Returns the current status of the receive (RX) FIFO sign-extended data.
23918  Description:
23919  This function returns the current status of the receive (RX) FIFO
23920  sign-extended data.
23921  This operation is atomic.
23922  Precondition:
23923  None.
23924  Parameters:
23925  index - Identifier for the device instance to be configured
23926  Returns:
23927  - true - Data from RX FIFO is sign-extended
23928  - false - Data from RX FIFO is not sign-extended
23929  Example:
23930  <code>
23931  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23932  // application developer.
23933  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
23934  </code>
23935  Remarks:
23936  This function implements an operation of the data sign feature.
23937  This feature may not be available on all devices. Please refer to the
23938  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
23939  in your application to automatically determine whether this feature is available.
23940  */
23941 
23942 bool
23944  SPI_MODULE_ID index ) ;
23945 //******************************************************************************
23946 /* Function:
23947  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
23948  Summary:
23949  Enables Master mode slave select.
23950  Description:
23951  This function enables Master mode slave select.
23952  This operation is atomic.
23953  Precondition:
23954  None.
23955  Parameters:
23956  index - Identifier for the device instance to be configured
23957  Returns:
23958  None.
23959  Example:
23960  <code>
23961  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23962  // application developer.
23963  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
23964  </code>
23965  Remarks:
23966  This feature does not support Framed SPI mode.
23967  This function implements an operation of the Master mode slave select feature.
23968  This feature may not be available on all devices. Please refer to the
23969  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23970  in your application to automatically determine whether this feature is available.
23971 
23972  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
23973  */
23974 
23975 void
23977  SPI_MODULE_ID index ) ;
23978 //******************************************************************************
23979 /* Function:
23980  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
23981  Summary:
23982  Disables Master mode slave select.
23983  Description:
23984  This function disables Master mode slave select.
23985  This operation is atomic.
23986  Precondition:
23987  None.
23988  Parameters:
23989  index - Identifier for the device instance to be configured
23990  Returns:
23991  None.
23992  Example:
23993  <code>
23994  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23995  // application developer.
23996  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
23997  </code>
23998  Remarks:
23999  This feature does not support Framed SPI mode.
24000  This function implements an operation of the slave select feature.
24001  This feature may not be available on all devices. Please refer to the
24002  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24003  in your application to automatically determine whether this feature is available.
24004 
24005  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24006  */
24007 
24008 void
24010  SPI_MODULE_ID index ) ;
24011 //******************************************************************************
24012 /* Function:
24013  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24014  Summary:
24015  Returns the current status of the transmit underrun.
24016  Description:
24017  This function returns the current status of the transmit underrun.
24018  This operation is atomic.
24019  Precondition:
24020  None.
24021  Parameters:
24022  index - Identifier for the device instance to be configured
24023  Returns:
24024  - true - Transmit buffer has encountered an underrun condition
24025  - false - Transmit buffer run has not encountered an underrun condition
24026  Example:
24027  <code>
24028  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24029  // application developer.
24030  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24031  </code>
24032  Remarks:
24033  Valid in Framed Sync mode.
24034  This function implements an operation of the transmit underrun status feature.
24035  This feature may not be available on all devices. Please refer to the
24036  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24037  in your application to automatically determine whether this feature is available.
24038  */
24039 
24040 bool
24042  SPI_MODULE_ID index ) ;
24043 //******************************************************************************
24044 /* Function:
24045  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24046  Summary:
24047  Clears the SPI transmit underrun flag.
24048  Description:
24049  This function clears the SPI transmit underrun flag.
24050  This operation is atomic.
24051  Precondition:
24052  None.
24053  Parameters:
24054  index - Identifier for the device instance to be configured
24055  Returns:
24056  None.
24057  Example:
24058  <code>
24059  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24060  // application developer.
24061  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24062  </code>
24063  Remarks:
24064  This function implements an operation of the transmit underrun status feature.
24065  This feature may not be available on all devices. Please refer to the
24066  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24067  in your application to automatically determine whether this feature is available.
24068  */
24069 
24070 void
24072  SPI_MODULE_ID index ) ;
24073 //******************************************************************************
24074 /* Function:
24075  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24076  Summary:
24077  Returns the current status of the transmit buffer.
24078  Description:
24079  This function returns the current status of the transmit buffer.
24080  This operation is atomic.
24081  Precondition:
24082  None.
24083  Parameters:
24084  index - Identifier for the device instance to be configured
24085  Returns:
24086  - true - Transmit buffer is empty
24087  - false - Transmit buffer is not empty
24088  Example:
24089  <code>
24090  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24091  // application developer.
24092  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24093  </code>
24094  Remarks:
24095  This function implements an operation of the transmit buffer empty status feature.
24096  This feature may not be available on all devices. Please refer to the
24097  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24098  in your application to automatically determine whether this feature is available.
24099  */
24100 
24101 bool
24103  SPI_MODULE_ID index ) ;
24104 //******************************************************************************
24105 /* Function:
24106  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24107  Summary:
24108  Enables the SPI enhanced buffer.
24109  Description:
24110  This function enables the SPI enhanced buffer.
24111  This operation is atomic.
24112  Precondition:
24113  None.
24114  Parameters:
24115  index - Identifier for the device instance to be configured
24116  Returns:
24117  None.
24118  Example:
24119  <code>
24120  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24121  // application developer.
24122  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24123  </code>
24124  Remarks:
24125  This enables the enhanced buffer mode.
24126  This function implements an operation of the FIFO control feature.
24127  This feature may not be available on all devices. Please refer to the
24128  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24129  in your application to automatically determine whether this feature is available.
24130  */
24131 
24132 void
24134  SPI_MODULE_ID index ) ;
24135 //******************************************************************************
24136 /* Function:
24137  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24138  Summary:
24139  Disables the SPI enhanced buffer.
24140  Description:
24141  This function disables the SPI enhanced buffer.
24142  This operation is atomic.
24143  Precondition:
24144  None.
24145  Parameters:
24146  index - Identifier for the device instance to be configured
24147  Returns:
24148  None.
24149  Example:
24150  <code>
24151  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24152  // application developer.
24153  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24154  </code>
24155  Remarks:
24156  Enables the legacy standard single buffer mode.
24157  This function implements an operation of the FIFO control feature.
24158  This feature may not be available on all devices. Please refer to the
24159  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24160  in your application to automatically determine whether this feature is available.
24161  */
24162 
24163 void
24165  SPI_MODULE_ID index ) ;
24166 //******************************************************************************
24167 /* Function:
24168  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24169  Summary:
24170  Reads the SPI Buffer Element Count bits for either receive or transmit.
24171  Description:
24172  This function reads the number of SPI transfers pending for Master mode
24173  and the number of unread SPI transfers for Slave mode.
24174  Precondition:
24175  None.
24176  Parameters:
24177  index - Identifier for the device instance to be configured
24178  type - One of the SPI_FIFO_TYPE enumeration values
24179  Returns:
24180  CountValue - Buffer element count bits
24181  Example:
24182  <code>
24183  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24184  // application developer.
24185  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24186  </code>
24187  Remarks:
24188  Valid in Enhanced Buffer mode.
24189  This function implements an operation of the FIFO control feature.
24190  This feature may not be available on all devices. Please refer to the
24191  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24192  in your application to automatically determine whether this feature is available.
24193  */
24194 
24195 uint8_t
24197  SPI_MODULE_ID index ,
24198  SPI_FIFO_TYPE type ) ;
24199 //******************************************************************************
24200 /* Function:
24201  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24202  Summary:
24203  Returns the current status of the SPI shift register.
24204  Description:
24205  This function returns the current status of the SPI shift register.
24206  This operation is atomic.
24207  Precondition:
24208  None.
24209  Parameters:
24210  index - Identifier for the device instance to be configured
24211  Returns:
24212  - true - SPI shift register is empty and ready to send or receive
24213  - false - SPI shift register is not empty
24214  Example:
24215  <code>
24216  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24217  // application developer.
24218  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24219  </code>
24220  Remarks:
24221  Valid in Enhanced Buffer mode.
24222  This function implements an operation of the FIFO status feature.
24223  This feature may not be available on all devices. Please refer to the
24224  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24225  in your application to automatically determine whether this feature is available.
24226  */
24227 
24228 bool
24230  SPI_MODULE_ID index ) ;
24231 //******************************************************************************
24232 /* Function:
24233  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24234  Summary:
24235  Returns the current status of the SPI receive FIFO.
24236  Description:
24237  This function returns the current status of the SPI receive FIFO.
24238  This operation is atomic.
24239  Precondition:
24240  None.
24241  Parameters:
24242  index - Identifier for the device instance to be configured
24243  Returns:
24244  - true - Receive FIFO is empty
24245  - false - Receive FIFO is not empty
24246  Example:
24247  <code>
24248  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24249  // application developer.
24250  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24251  </code>
24252  Remarks:
24253  Valid in Enhanced Buffer mode.
24254  This function implements an operation of the FIFO status feature.
24255  This feature may not be available on all devices. Please refer to the
24256  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24257  in your application to automatically determine whether this feature is available.
24258  */
24259 
24260 bool
24262  SPI_MODULE_ID index ) ;
24263 //******************************************************************************
24264 /* Function:
24265  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24266  SPI_FIFO_INTERRUPT mode)
24267  Summary:
24268  Selects the SPI buffer interrupt mode.
24269  Description:
24270  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24271  Precondition:
24272  None.
24273  Parameters:
24274  index - Identifier for the device instance to be configured
24275  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24276  interrupt mode
24277  Returns:
24278  None.
24279  Example:
24280  <code>
24281  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24282  // application developer.
24283  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24284  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24285  </code>
24286  Remarks:
24287  Valid in Enhanced Buffer mode.
24288  This function implements an operation of the FIFO interrupt feature.
24289  This feature may not be available on all devices. Please refer to the
24290  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24291  in your application to automatically determine whether this feature is available.
24292  */
24293 
24294 void
24296  SPI_MODULE_ID index ,
24297  SPI_FIFO_INTERRUPT mode ) ;
24298 //******************************************************************************
24299 /* Function:
24300  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24301  Summary:
24302  Enables framed SPI support.
24303  Description:
24304  This function enables framed SPI support.
24305  This operation is atomic.
24306  Precondition:
24307  None.
24308  Parameters:
24309  index - Identifier for the device instance to be configured
24310  Returns:
24311  None.
24312  Example:
24313  <code>
24314  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24315  // application developer.
24316  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24317  </code>
24318  Remarks:
24319  This function implements an operation of the framed communication feature.
24320  This feature may not be available on all devices. Please refer to the
24321  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24322  in your application to automatically determine whether this feature is available.
24323  */
24324 
24325 void
24327  SPI_MODULE_ID index ) ;
24328 //******************************************************************************
24329 /* Function:
24330  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24331  Summary:
24332  Disables framed SPI support.
24333  Description:
24334  This function disables framed SPI support.
24335  This operation is atomic.
24336  Precondition:
24337  None.
24338  Parameters:
24339  index - Identifier for the device instance to be configured
24340  Returns:
24341  None.
24342  Example:
24343  <code>
24344  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24345  // application developer.
24346  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24347  </code>
24348  Remarks:
24349  This function implements an operation of the framed communication feature.
24350  This feature may not be available on all devices. Please refer to the
24351  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24352  in your application to automatically determine whether this feature is available.
24353  */
24354 
24355 void
24357  SPI_MODULE_ID index ) ;
24358 //******************************************************************************
24359 /* Function:
24360  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24361  SPI_FRAME_PULSE_DIRECTION direction)
24362  Summary:
24363  Selects the frame sync pulse direction.
24364  Description:
24365  This function selects the frame sync pulse direction.
24366  Precondition:
24367  None.
24368  Parameters:
24369  index - Identifier for the device instance to be configured
24370  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24371  as the SPI frame sync pulse polarity
24372  Returns:
24373  None.
24374  Example:
24375  <code>
24376  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24377  // application developer.
24378  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24379  </code>
24380  Remarks:
24381  This function implements an operation of the framed communication feature.
24382  This feature may not be available on all devices. Please refer to the
24383  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24384  in your application to automatically determine whether this feature is available.
24385  */
24386 
24387 void
24389  SPI_MODULE_ID index ,
24390  SPI_FRAME_PULSE_DIRECTION direction ) ;
24391 //******************************************************************************
24392 /* Function:
24393  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24394  SPI_FRAME_PULSE_POLARITY polarity)
24395  Summary:
24396  Selects the frame sync pulse polarity.
24397  Description:
24398  This function selects the frame sync pulse polarity.
24399  Precondition:
24400  None.
24401  Parameters:
24402  index - Identifier for the device instance to be configured
24403  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24404  sync pulse polarity
24405  Returns:
24406  None.
24407  Example:
24408  <code>
24409  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24410  // application developer.
24411  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24412  </code>
24413  Remarks:
24414  Available only for Frame mode.
24415  This function implements an operation of the framed communication feature.
24416  This feature may not be available on all devices. Please refer to the
24417  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24418  in your application to automatically determine whether this feature is available.
24419  */
24420 
24421 void
24423  SPI_MODULE_ID index ,
24424  SPI_FRAME_PULSE_POLARITY polarity ) ;
24425 //******************************************************************************
24426 /* Function:
24427  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24428  SPI_FRAME_PULSE_EDGE edge)
24429  Summary:
24430  Selects the frame sync pulse edge.
24431  Description:
24432  This function selects the frame sync pulse edge.
24433  Precondition:
24434  None.
24435  Parameters:
24436  index - Identifier for the device instance to be configured
24437  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24438  SPI frame sync pulse edge
24439  Returns:
24440  None.
24441  Example:
24442  <code>
24443  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24444  // application developer.
24445  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24446  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24447  </code>
24448  Remarks:
24449  This function implements an operation of the framed communication feature.
24450  This feature may not be available on all devices. Please refer to the
24451  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24452  in your application to automatically determine whether this feature is available.
24453  */
24454 
24455 void
24457  SPI_MODULE_ID index ,
24458  SPI_FRAME_PULSE_EDGE edge ) ;
24459 //******************************************************************************
24460 /* Function:
24461  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24462  SPI_FRAME_PULSE_WIDTH width)
24463  Summary:
24464  Sets the frame sync pulse width.
24465  Description:
24466  This function sets the frame sync pulse width.
24467  Precondition:
24468  None.
24469  Parameters:
24470  index - Identifier for the device instance to be configured
24471  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24472  frame sync pulse width.
24473  Returns:
24474  None.
24475  Example:
24476  <code>
24477  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24478  // application developer.
24479  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24480  </code>
24481  Remarks:
24482  Length of the word is dependent on the communication mode.
24483  This function implements an operation of the framed communication feature.
24484  This feature may not be available on all devices. Please refer to the
24485  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24486  in your application to automatically determine whether this feature is available.
24487  */
24488 
24489 void
24491  SPI_MODULE_ID index ,
24492  SPI_FRAME_PULSE_WIDTH width ) ;
24493 //******************************************************************************
24494 /* Function:
24495  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24496  SPI_FRAME_SYNC_PULSE pulse)
24497  Summary:
24498  Selects at which character the SPI frame sync pulse is generated.
24499  Description:
24500  This function selects at which character the SPI frame sync pulse is generated.
24501  Precondition:
24502  None.
24503  Parameters:
24504  index - Identifier for the device instance to be configured
24505  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24506  frame sync pulse count
24507  Returns:
24508  None.
24509  Example:
24510  <code>
24511  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24512  // application developer.
24513  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24514  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24515  </code>
24516  Remarks:
24517  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24518  This function implements an operation of the framed communication feature.
24519  This feature may not be available on all devices. Please refer to the
24520  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24521  in your application to automatically determine whether this feature is available.
24522  */
24523 
24524 void
24526  SPI_MODULE_ID index ,
24527  SPI_FRAME_SYNC_PULSE pulse ) ;
24528 //******************************************************************************
24529 /* Function:
24530  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24531  Summary:
24532  Returns the current status of the SPI frame error.
24533  Description:
24534  This function returns the current status of the SPI frame error.
24535  This operation is atomic.
24536  Precondition:
24537  None.
24538  Parameters:
24539  index - Identifier for the device instance to be configured
24540  Returns:
24541  - true - Frame error detected
24542  - false - No frame error detected
24543  Example:
24544  <code>
24545  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24546  // application developer.
24547  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24548  </code>
24549  Remarks:
24550  Valid only if Frame mode is enabled.
24551  This function implements an operation of the framed communication feature.
24552  This feature may not be available on all devices. Please refer to the
24553  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24554  in your application to automatically determine whether this feature is available.
24555  */
24556 
24557 bool
24559  SPI_MODULE_ID index ) ;
24560 //******************************************************************************
24561 /* Function:
24562  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24563  Summary:
24564  Clears the SPI frame error flag.
24565  Description:
24566  This function clears the SPI frame error flag.
24567  This operation is atomic.
24568  Precondition:
24569  None.
24570  Parameters:
24571  index - Identifier for the device instance to be configured
24572  Returns:
24573  None.
24574  Example:
24575  <code>
24576  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24577  // application developer.
24578  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24579  </code>
24580  Remarks:
24581  This function implements an operation of the frame error status feature.
24582  This feature may not be available on all devices. Please refer to the
24583  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24584  in your application to automatically determine whether this feature is available.
24585  */
24586 
24587 void
24589  SPI_MODULE_ID index ) ;
24590 //******************************************************************************
24591 /* Function:
24592  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24593  Summary:
24594  Clears the SPI receive buffer.
24595  Description:
24596  This function clears the SPI receive buffer.
24597  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24598  This operation is atomic.
24599  Precondition:
24600  None.
24601  Parameters:
24602  index - Identifier for the device instance to be configured
24603  Returns:
24604  None.
24605  Example:
24606  <code>
24607  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24608  // application developer.
24609  //This call will flush the receive buffer.
24610  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24611  </code>
24612  Remarks:
24613  This function implements an operation of the buffer control feature.
24614  This feature may not be available on all devices. Please refer to the
24615  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24616  in your application to automatically determine whether this feature is available.
24617  */
24618 
24619 void
24621  SPI_MODULE_ID index ) ;
24622 //******************************************************************************
24623 /* Function:
24624  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24625  Summary:
24626  Returns the SPI buffer value.
24627  Description:
24628  This function returns the SPI buffer value.
24629  This operation is atomic.
24630  Precondition:
24631  None.
24632  Parameters:
24633  index - Identifier for the device instance to be configured
24634  Returns:
24635  Reads the SPI buffer.
24636  Example:
24637  <code>
24638  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24639  // application developer.
24640  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24641  </code>
24642  Remarks:
24643  This function implements an operation of the buffer control feature.
24644  This feature may not be available on all devices. Please refer to the
24645  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24646  in your application to automatically determine whether this feature is available.
24647  */
24648 
24649 uint8_t
24651  SPI_MODULE_ID index ) ;
24652 //******************************************************************************
24653 /* Function:
24654  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24655  Summary:
24656  Returns 16-bit SPI buffer value.
24657  Description:
24658  This function returns 16-bit SPI buffer value.
24659  This operation is atomic.
24660  Precondition:
24661  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24662  Parameters:
24663  index - Identifier for the device instance to be configured
24664  Returns:
24665  Returns the SPI 16-bit buffer value.
24666  Example:
24667  <code>
24668 #define MY_SPI_INSTANCE SPI_ID_1
24669 
24670  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24671  </code>
24672  Remarks:
24673  This function implements an operation of the buffer control feature.
24674  This feature may not be available on all devices. Please refer to the
24675  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24676  in your application to automatically determine whether this feature is available.
24677  */
24678 
24679 uint16_t
24681  SPI_MODULE_ID index ) ;
24682 //******************************************************************************
24683 /* Function:
24684  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24685  Summary:
24686  Returns 32-bit SPI buffer value.
24687  Description:
24688  This function returns 32-bit SPI buffer value.
24689  This operation is atomic.
24690  Precondition:
24691  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24692  Parameters:
24693  index - Identifier for the device instance to be configured
24694  Returns:
24695  Returns the SPI 32-bit buffer value.
24696  Example:
24697  <code>
24698 #define MY_SPI_INSTANCE SPI_ID_1
24699 
24700  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24701  </code>
24702  Remarks:
24703  This function implements an operation of the buffer control feature.
24704  This feature may not be available on all devices. Please refer to the
24705  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24706  in your application to automatically determine whether this feature is available.
24707  */
24708 
24709 uint32_t
24711  SPI_MODULE_ID index ) ;
24712 //******************************************************************************
24713 /* Function:
24714  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24715  Summary:
24716  Write the data to the SPI buffer.
24717  Description:
24718  This function writes data to the SPI buffer.
24719  This operation is atomic.
24720  Precondition:
24721  None.
24722  Parameters:
24723  index - Identifier for the device instance to be configured
24724  data - Data to written to the SPI buffer
24725  Returns:
24726  None.
24727  Example:
24728  <code>
24729  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24730  // application developer.
24731  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24732  </code>
24733  Remarks:
24734  This function implements an operation of the buffer control feature.
24735  This feature may not be available on all devices. Please refer to the
24736  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24737  in your application to automatically determine whether this feature is available.
24738  */
24739 
24740 void
24742  SPI_MODULE_ID index ,
24743  uint8_t data ) ;
24744 //******************************************************************************
24745 /* Function:
24746  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24747  Summary:
24748  Writes 16-bit data to the SPI buffer.
24749  Description:
24750  This function writes 16-bit data to the SPI buffer.
24751  This operation is atomic.
24752  Precondition:
24753  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24754  Parameters:
24755  index - Identifier for the device instance to be configured
24756  data - 16-bit data to be written to the SPI buffer
24757  Returns:
24758  None.
24759  Example:
24760  <code>
24761 #define MY_SPI_INSTANCE SPI_ID_1
24762 
24763  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24764  </code>
24765  Remarks:
24766  This function implements an operation of the buffer control feature.
24767  This feature may not be available on all devices. Please refer to the
24768  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24769  in your application to automatically determine whether this feature is available.
24770  */
24771 
24772 void
24774  SPI_MODULE_ID index ,
24775  uint16_t data ) ;
24776 //******************************************************************************
24777 /* Function:
24778  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24779  Summary:
24780  Write 32-bit data to the SPI buffer.
24781  Description:
24782  This function writes 32-bit data to the SPI buffer.
24783  This operation is atomic.
24784  Precondition:
24785  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24786  Parameters:
24787  index - Identifier for the device instance to be configured
24788  data - 32-bit data to be written to the SPI buffer
24789  Returns:
24790  None.
24791  Example:
24792  <code>
24793 #define MY_SPI_INSTANCE SPI_ID_1
24794 
24795  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24796  </code>
24797  Remarks:
24798  This function implements an operation of the buffer control feature.
24799  This feature may not be available on all devices. Please refer to the
24800  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24801  in your application to automatically determine whether this feature is available.
24802  */
24803 
24804 void
24806  SPI_MODULE_ID index ,
24807  uint32_t data ) ;
24808 //******************************************************************************
24809 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24810  Summary:
24811  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24812  register.
24813  Description:
24814  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24815  (SPIxRXB)) register.
24816  This operation is atomic.
24817  Preconditions:
24818  None.
24819  Parameters:
24820  index - Identifier for the device instance
24821  Returns:
24822  The address of the SPIxBUF register
24823  Remarks:
24824  None.
24825 */
24826 
24827 void *
24829  SPI_MODULE_ID index ) ;
24830 //******************************************************************************
24831 /* Function:
24832  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24833  SPI_BAUD_RATE_CLOCK type)
24834  Summary:
24835  Selects the type of clock is used by the Baud Rate Generator.
24836  Description:
24837  This function selects the type of clock is used by the Baud Rate Generator.
24838  Precondition:
24839  None.
24840  Parameters:
24841  index - Identifier for the device instance to be configured
24842  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24843  Returns:
24844  None.
24845  Example:
24846  <code>
24847  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24848  // application developer.
24849  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24850  </code>
24851  Remarks:
24852  This function implements an operation of the baud rate clock control feature.
24853  This feature may not be available on all devices. Please refer to the
24854  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24855  in your application to automatically determine whether this feature is available.
24856  */
24857 
24858 void
24860  SPI_MODULE_ID index ,
24861  SPI_BAUD_RATE_CLOCK type ) ;
24862 //******************************************************************************
24863 /* Function:
24864  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24865  SPI_ERROR_INTERRUPT error)
24866  Summary:
24867  Enables SPI error interrupts
24868  Description:
24869  This function enables SPI error interrupts.
24870  Precondition:
24871  None.
24872  Parameters:
24873  index - Identifier for the device instance to be configured
24874  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24875  SPI interrupt error
24876  Returns:
24877  None.
24878  Example:
24879  <code>
24880  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24881  // application developer.
24882  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24883  </code>
24884  Remarks:
24885  This function implements an operation of the error interrupt control feature.
24886  This feature may not be available on all devices. Please refer to the
24887  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24888  in your application to automatically determine whether this feature is available.
24889  */
24890 
24891 void
24893  SPI_MODULE_ID index ,
24894  SPI_ERROR_INTERRUPT error ) ;
24895 //******************************************************************************
24896 /* Function:
24897  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24898  SPI_ERROR_INTERRUPT error)
24899  Summary:
24900  Enables SPI error interrupts.
24901  Description:
24902  This function enables SPI error interrupts.
24903  Precondition:
24904  None.
24905  Parameters:
24906  index - Identifier for the device instance to be configured
24907  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24908  SPI interrupt error
24909  Returns:
24910  None.
24911  Example:
24912  <code>
24913  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24914  // application developer.
24915  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24916  </code>
24917  Remarks:
24918  This function implements an operation of the error interrupt control feature.
24919  This feature may not be available on all devices. Please refer to the
24920  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24921  in your application to automatically determine whether this feature is available.
24922  */
24923 
24924 void
24926  SPI_MODULE_ID index ,
24927  SPI_ERROR_INTERRUPT error ) ;
24928 //******************************************************************************
24929 /* Function:
24930  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
24931  Summary:
24932  Enables the SPI error.
24933  Description:
24934  This function enables the SPI error.
24935  This operation is atomic.
24936  Precondition:
24937  None.
24938  Parameters:
24939  index - Identifier for the device instance to be configured
24940  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24941  Returns:
24942  None.
24943  Example:
24944  <code>
24945  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24946  // application developer.
24947  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24948  </code>
24949  Remarks:
24950  This function implements an operation of the audio error control feature.
24951  This feature may not be available on all devices. Please refer to the
24952  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24953  in your application to automatically determine whether this feature is available.
24954  */
24955 
24956 void
24958  SPI_MODULE_ID index ,
24959  SPI_AUDIO_ERROR error ) ;
24960 //******************************************************************************
24961 /* Function:
24962  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
24963  Summary:
24964  Disables the SPI error.
24965  Description:
24966  This function disables the SPI error.
24967  This operation is atomic.
24968  Precondition:
24969  None.
24970  Parameters:
24971  index - Identifier for the device instance to be configured
24972  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24973  Returns:
24974  None.
24975  Example:
24976  <code>
24977  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24978  // application developer.
24979  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24980  </code>
24981  Remarks:
24982  This function implements an operation of the audio error control feature.
24983  This feature may not be available on all devices. Please refer to the
24984  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24985  in your application to automatically determine whether this feature is available.
24986  */
24987 
24988 void
24990  SPI_MODULE_ID index ,
24991  SPI_AUDIO_ERROR error ) ;
24992 //******************************************************************************
24993 /* Function:
24994  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
24995  Summary:
24996  Audio protocol is enabled.
24997  Description:
24998  This function enables the audio protocol.
24999  This operation is atomic.
25000  Precondition:
25001  Disable the SPI module by calling PLIB_SPI_Disable.
25002  Parameters:
25003  index - Identifier for the device instance to be configured
25004  Returns:
25005  None.
25006  Example:
25007  <code>
25008  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25009  // application developer.
25010  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25011  </code>
25012  Remarks:
25013  This function implements an operation of the audio protocol control feature.
25014  This feature may not be available on all devices. Please refer to the
25015  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25016  in your application to automatically determine whether this feature is available.
25017  */
25018 
25019 void
25021  SPI_MODULE_ID index ) ;
25022 //******************************************************************************
25023 /* Function:
25024  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25025  Summary:
25026  Audio protocol is disabled.
25027  Description:
25028  This function disables the audio protocol.
25029  This operation is atomic.
25030  Precondition:
25031  None.
25032  Parameters:
25033  index - Identifier for the device instance to be configured
25034  Returns:
25035  None.
25036  Example:
25037  <code>
25038  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25039  // application developer.
25040  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25041  </code>
25042  Remarks:
25043  This function implements an operation of the audio protocol control feature.
25044  This feature may not be available on all devices. Please refer to the
25045  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25046  in your application to automatically determine whether this feature is available.
25047  */
25048 
25049 void
25051  SPI_MODULE_ID index ) ;
25052 //******************************************************************************
25053 /* Function:
25054  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25055  SPI_AUDIO_TRANSMIT_MODE mode)
25056  Summary:
25057  Selects the transmit audio data format.
25058  Description:
25059  This function selects the transmit audio data format.
25060  Precondition:
25061  None.
25062  Parameters:
25063  index - Identifier for the device instance to be configured
25064  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25065  transmit audio format
25066  Returns:
25067  None.
25068  Example:
25069  <code>
25070  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25071  // application developer.
25072  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25073  </code>
25074  Remarks:
25075  This function implements an operation of the audio transmit mode feature.
25076  This feature may not be available on all devices. Please refer to the
25077  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25078  in your application to automatically determine whether this feature is available.
25079  */
25080 
25081 void
25083  SPI_MODULE_ID index ,
25084  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25085 //******************************************************************************
25086 /* Function:
25087  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25088  SPI_AUDIO_PROTOCOL mode )
25089  Summary:
25090  Selects the Audio Protocol mode.
25091  Description:
25092  This function selects the Audio Protocol mode.
25093  Precondition:
25094  None.
25095  Parameters:
25096  index - Identifier for the device instance to be configured
25097  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25098  audio protocol
25099  Returns:
25100  None.
25101  Example:
25102  <code>
25103  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25104  // application developer.
25105  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25106  </code>
25107  Remarks:
25108  This function implements an operation of the audio protocol mode feature.
25109  This feature may not be available on all devices. Please refer to the
25110  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25111  in your application to automatically determine whether this feature is available.
25112  */
25113 
25114 void
25116  SPI_MODULE_ID index ,
25117  SPI_AUDIO_PROTOCOL mode ) ;
25118 // *****************************************************************************
25119 // *****************************************************************************
25120 // Section: SPI Peripheral Library Exists Functions
25121 // *****************************************************************************
25122 // *****************************************************************************
25123 /* The following functions indicate the existence of the features on the device.
25124 */
25125 //******************************************************************************
25126 /* Function:
25127  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25128  Summary:
25129  Identifies whether the EnableControl feature exists on the SPI module.
25130  Description:
25131  This function identifies whether the EnableControl feature is available on
25132  the SPI module.
25133  When this function returns true, these functions are supported on the device:
25134  - PLIB_SPI_Enable
25135  - PLIB_SPI_Disable
25136  This operation is atomic.
25137  Preconditions:
25138  None.
25139  Parameters:
25140  index - Identifier for the device instance
25141  Returns:
25142  - true - The EnableControl feature is supported on the device
25143  - false - The EnableControl feature is not supported on the device
25144  Remarks:
25145  None.
25146 */
25147 
25148 bool
25150  SPI_MODULE_ID index ) ;
25151 //******************************************************************************
25152 /* Function:
25153  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25154  Summary:
25155  Identifies whether the StopInIdle feature exists on the SPI module.
25156  Description:
25157  This function identifies whether the StopInIdle feature is available on the
25158  SPI module.
25159  When this function returns true, these functions are supported on the device:
25160  - PLIB_SPI_StopInIdleEnable
25161  - PLIB_SPI_StopInIdleDisable
25162  This operation is atomic.
25163  Preconditions:
25164  None.
25165  Parameters:
25166  index - Identifier for the device instance
25167  Returns:
25168  - true - The StopInIdle feature is supported on the device
25169  - false - The StopInIdle feature is not supported on the device
25170  Remarks:
25171  None.
25172 */
25173 
25174 bool
25176  SPI_MODULE_ID index ) ;
25177 //******************************************************************************
25178 /* Function:
25179  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25180  Summary:
25181  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25182  Description:
25183  This function identifies whether the ReceiverOverflow feature is available
25184  on the SPI module.
25185  When this function returns true, these functions are supported on the device:
25186  - PLIB_SPI_ReceiverHasOverflowed
25187  - PLIB_SPI_ReceiverOverflowClear
25188  This operation is atomic.
25189  Preconditions:
25190  None.
25191  Parameters:
25192  index - Identifier for the device instance
25193  Returns:
25194  - true - The ReceiverOverflow feature is supported on the device
25195  - false - The ReceiverOverflow feature is not supported on the device
25196  Remarks:
25197  None.
25198 */
25199 
25200 bool
25202  SPI_MODULE_ID index ) ;
25203 //******************************************************************************
25204 /* Function:
25205  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25206  Summary:
25207  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25208  Description:
25209  This function identifies whether the TransmitBufferFullStatus feature is available
25210  on the SPI module.
25211  When this function returns true, this function is supported on the device:
25212  - PLIB_SPI_TransmitBufferIsFull
25213  This operation is atomic.
25214  Preconditions:
25215  None.
25216  Parameters:
25217  index - Identifier for the device instance
25218  Returns:
25219  - true - The TransmitBufferFullStatus feature is supported on the device
25220  - false - The TransmitBufferFullStatus feature is not supported on the device
25221  Remarks:
25222  None.
25223 */
25224 
25225 bool
25227  SPI_MODULE_ID index ) ;
25228 //******************************************************************************
25229 /* Function:
25230  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25231  Summary:
25232  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25233  Description:
25234  This function identifies whether the TransmitBufferEmptyStatus feature is available
25235  on the SPI module.
25236  When this function returns true, this function is supported on the device:
25237  - PLIB_SPI_TransmitBufferIsEmpty
25238  This operation is atomic.
25239  Preconditions:
25240  None.
25241  Parameters:
25242  index - Identifier for the device instance
25243  Returns:
25244  - true - The TransmitBufferEmptyStatus feature is supported on the device
25245  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25246  Remarks:
25247  None.
25248 */
25249 
25250 bool
25252  SPI_MODULE_ID index ) ;
25253 //******************************************************************************
25254 /* Function:
25255  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25256  Summary:
25257  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25258  Description:
25259  This function identifies whether the ReceiveBufferStatus feature is available
25260  on the SPI module.
25261  When this function returns true, this function is supported on the device:
25262  - PLIB_SPI_ReceiverBufferIsFull
25263  This operation is atomic.
25264  Preconditions:
25265  None.
25266  Parameters:
25267  index - Identifier for the device instance
25268  Returns:
25269  - true - The ReceiveBufferStatus feature is supported on the device
25270  - false - The ReceiveBufferStatus feature is not supported on the device
25271  Remarks:
25272  None.
25273 */
25274 
25275 bool
25277  SPI_MODULE_ID index ) ;
25278 //******************************************************************************
25279 /* Function:
25280  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25281  Summary:
25282  Identifies whether the PinControl feature exists on the SPI module.
25283  Description:
25284  This function identifies whether the PinControl feature is available on the
25285  SPI module.
25286  When this function returns true, these functions are supported on the device:
25287  - PLIB_SPI_PinEnable
25288  - PLIB_SPI_PinDisable
25289  This operation is atomic.
25290  Preconditions:
25291  None.
25292  Parameters:
25293  index - Identifier for the device instance
25294  Returns:
25295  - true - The PinControl feature is supported on the device
25296  - false - The PinControl feature is not supported on the device
25297  Remarks:
25298  None.
25299 */
25300 
25301 bool
25303  SPI_MODULE_ID index ) ;
25304 //******************************************************************************
25305 /* Function:
25306  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25307  Summary:
25308  Identifies whether the CommunicationWidth feature exists on the SPI module.
25309  Description:
25310  This function identifies whether the CommunicationWidth feature is available
25311  on the SPI module.
25312  When this function returns true, this function is supported on the device:
25313  - PLIB_SPI_CommunicationWidthSelect
25314  This operation is atomic.
25315  Preconditions:
25316  None.
25317  Parameters:
25318  index - Identifier for the device instance
25319  Returns:
25320  - true - The CommunicationWidth feature is supported on the device
25321  - false - The CommunicationWidth feature is not supported on the device
25322  Remarks:
25323  None.
25324 */
25325 
25326 bool
25328  SPI_MODULE_ID index ) ;
25329 //******************************************************************************
25330 /* Function:
25331  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25332  Summary:
25333  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25334  Description:
25335  This function identifies whether the AudioCommunicationWidth feature is available
25336  on the SPI module.
25337  When this function returns true, this function is supported on the device:
25338  - PLIB_SPI_AudioCommunicationWidthSelect
25339  This operation is atomic.
25340  Preconditions:
25341  None.
25342  Parameters:
25343  index - Identifier for the device instance
25344  Returns:
25345  - true - The AudioCommunicationWidth feature is supported on the device
25346  - false - The AudioCommunicationWidth feature is not supported on the device
25347  Remarks:
25348  None.
25349 */
25350 
25351 bool
25353  SPI_MODULE_ID index ) ;
25354 //******************************************************************************
25355 /* Function:
25356  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25357  Summary:
25358  Identifies whether the InputSamplePhase feature exists on the SPI module.
25359  Description:
25360  This function identifies whether the InputSamplePhase feature is available
25361  on the SPI module.
25362  When this function returns true, this function is supported on the device:
25363  - PLIB_SPI_InputSamplePhaseSelect
25364  This operation is atomic.
25365  Preconditions:
25366  None.
25367  Parameters:
25368  index - Identifier for the device instance
25369  Returns:
25370  - true - The InputSamplePhase feature is supported on the device
25371  - false - The InputSamplePhase feature is not supported on the device
25372  Remarks:
25373  None.
25374 */
25375 
25376 bool
25378  SPI_MODULE_ID index ) ;
25379 //******************************************************************************
25380 /* Function:
25381  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25382  Summary:
25383  Identifies whether the OutputDataPhase feature exists on the SPI module.
25384  Description:
25385  This function identifies whether the OutputDataPhase feature is available on
25386  the SPI module.
25387  When this function returns true, this function is supported on the device:
25388  - PLIB_SPI_OutputDataPhaseSelect
25389  This operation is atomic.
25390  Preconditions:
25391  None.
25392  Parameters:
25393  index - Identifier for the device instance
25394  Returns:
25395  - true - The OutputDataPhase feature is supported on the device
25396  - false - The OutputDataPhase feature is not supported on the device
25397  Remarks:
25398  None.
25399 */
25400 
25401 bool
25403  SPI_MODULE_ID index ) ;
25404 //******************************************************************************
25405 /* Function:
25406  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25407  Summary:
25408  Identifies whether the ClockPolarity feature exists on the SPI module.
25409  Description:
25410  This function identifies whether the ClockPolarity feature is available on
25411  the SPI module.
25412  When this function returns true, this function is supported on the device:
25413  - PLIB_SPI_ClockPolaritySelect
25414  This operation is atomic.
25415  Preconditions:
25416  None.
25417  Parameters:
25418  index - Identifier for the device instance
25419  Returns:
25420  - true - The ClockPolarity feature is supported on the device
25421  - false - The ClockPolarity feature is not supported on the device
25422  Remarks:
25423  None.
25424 */
25425 
25426 bool
25428  SPI_MODULE_ID index ) ;
25429 //******************************************************************************
25430 /* Function:
25431  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25432  Summary:
25433  Identifies whether the MasterControl feature exists on the SPI module.
25434  Description:
25435  This function identifies whether the MasterControl feature is available on
25436  the SPI module.
25437  When this function returns true, these functions are supported on the device:
25438  - PLIB_SPI_MasterEnable
25439  - PLIB_SPI_SlaveEnable
25440  This operation is atomic.
25441  Preconditions:
25442  None.
25443  Parameters:
25444  index - Identifier for the device instance
25445  Returns:
25446  - true - The MasterControl feature is supported on the device
25447  - false - The MasterControl feature is not supported on the device
25448  Remarks:
25449  None.
25450 */
25451 
25452 bool
25454  SPI_MODULE_ID index ) ;
25455 //******************************************************************************
25456 /* Function:
25457  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25458  Summary:
25459  Identifies whether the BaudRate feature exists on the SPI module.
25460  Description:
25461  This function identifies whether the BaudRate feature is available on the SPI
25462  module.
25463  When this function returns true, this function is supported on the device:
25464  - PLIB_SPI_BaudRateSet
25465  This operation is atomic.
25466  Preconditions:
25467  None.
25468  Parameters:
25469  index - Identifier for the device instance
25470  Returns:
25471  - true - The BaudRate feature is supported on the device
25472  - false - The BaudRate feature is not supported on the device
25473  Remarks:
25474  None.
25475 */
25476 
25477 bool
25479  SPI_MODULE_ID index ) ;
25480 //******************************************************************************
25481 /* Function:
25482  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25483  Summary:
25484  Identifies whether the BusStatus feature exists on the SPI module.
25485  Description:
25486  This function identifies whether the BusStatus feature is available on the
25487  SPI module.
25488  When this function returns true, this function is supported on the device:
25489  - PLIB_SPI_IsBusy
25490  This operation is atomic.
25491  Preconditions:
25492  None.
25493  Parameters:
25494  index - Identifier for the device instance
25495  Returns:
25496  - true - The BusStatus feature is supported on the device
25497  - false - The BusStatus feature is not supported on the device
25498  Remarks:
25499  None.
25500 */
25501 
25502 bool
25504  SPI_MODULE_ID index ) ;
25505 //******************************************************************************
25506 /* Function:
25507  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25508  Summary:
25509  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25510  Description:
25511  This function identifies whether the ReadDataSignStatus feature is available
25512  on the SPI module.
25513  When this function returns true, this function is supported on the device:
25514  - PLIB_SPI_ReadDataIsSignExtended
25515  This operation is atomic.
25516  Preconditions:
25517  None.
25518  Parameters:
25519  index - Identifier for the device instance
25520  Returns:
25521  - true - The ReadDataSignStatus feature is supported on the device
25522  - false - The ReadDataSignStatus feature is not supported on the device
25523  Remarks:
25524  None.
25525 */
25526 
25527 bool
25529  SPI_MODULE_ID index ) ;
25530 //******************************************************************************
25531 /* Function:
25532  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25533  Summary:
25534  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25535  Description:
25536  This function identifies whether the SlaveSelectControl feature is available
25537  on the SPI module.
25538  When this function returns true, these functions are supported on the device:
25539  - PLIB_SPI_SlaveSelectEnable
25540  - PLIB_SPI_SlaveSelectDisable
25541  This operation is atomic.
25542  Preconditions:
25543  None.
25544  Parameters:
25545  index - Identifier for the device instance
25546  Returns:
25547  - true - The SlaveSelectControl feature is supported on the device
25548  - false - The SlaveSelectControl feature is not supported on the device
25549  Remarks:
25550  None.
25551 */
25552 
25553 bool
25555  SPI_MODULE_ID index ) ;
25556 //******************************************************************************
25557 /* Function:
25558  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25559  Summary:
25560  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25561  Description:
25562  This function identifies whether the TransmitUnderRunStatus feature is available
25563  on the SPI module.
25564  When this function returns true, these functions are supported on the device:
25565  - PLIB_SPI_TransmitUnderRunStatusGet
25566  - PLIB_SPI_TransmitUnderRunStatusClear
25567  This operation is atomic.
25568  Preconditions:
25569  None.
25570  Parameters:
25571  index - Identifier for the device instance
25572  Returns:
25573  - true - The TransmitUnderRunStatus feature is supported on the device
25574  - false - The TransmitUnderRunStatus feature is not supported on the device
25575  Remarks:
25576  None.
25577 */
25578 
25579 bool
25581  SPI_MODULE_ID index ) ;
25582 //******************************************************************************
25583 /* Function:
25584  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25585  Summary:
25586  Identifies whether the FIFOControl feature exists on the SPI module.
25587  Description:
25588  This function identifies whether the FIFOControl feature is available on the
25589  SPI module.
25590  When this function returns true, these functions are supported on the device:
25591  - PLIB_SPI_FIFOEnable
25592  - PLIB_SPI_FIFODisable
25593  This operation is atomic.
25594  Preconditions:
25595  None.
25596  Parameters:
25597  index - Identifier for the device instance
25598  Returns:
25599  - true - The FIFOControl feature is supported on the device
25600  - false - The FIFOControl feature is not supported on the device
25601  Remarks:
25602  None.
25603 */
25604 
25605 bool
25607  SPI_MODULE_ID index ) ;
25608 //******************************************************************************
25609 /* Function:
25610  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25611  Summary:
25612  Identifies whether the FIFOCount feature exists on the SPI module.
25613  Description:
25614  This function identifies whether the FIFOCount feature is available on the SPI module.
25615  When this function returns true, this function is supported on the device:
25616  - PLIB_SPI_FIFOCountGet
25617  This operation is atomic.
25618  Preconditions:
25619  None.
25620  Parameters:
25621  index - Identifier for the device instance
25622  Returns:
25623  - true - The FIFOCount feature is supported on the device
25624  - false - The FIFOCount feature is not supported on the device
25625  Remarks:
25626  None.
25627 */
25628 
25629 bool
25631  SPI_MODULE_ID index ) ;
25632 //******************************************************************************
25633 /* Function:
25634  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25635  Summary:
25636  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25637  Description:
25638  This function identifies whether the ReceiveFIFOStatus feature is available
25639  on the SPI module.
25640  When this function returns true, this function is supported on the device:
25641  - PLIB_SPI_ReceiverFIFOIsEmpty
25642  This operation is atomic.
25643  Preconditions:
25644  None.
25645  Parameters:
25646  index - Identifier for the device instance
25647  Returns:
25648  - true - The ReceiveFIFOStatus feature is supported on the device
25649  - false - The ReceiveFIFOStatus feature is not supported on the device
25650  Remarks:
25651  None.
25652 */
25653 
25654 bool
25656  SPI_MODULE_ID index ) ;
25657 //******************************************************************************
25658 /* Function:
25659  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25660  Summary:
25661  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25662  Description:
25663  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25664  available on the SPI module.
25665  When this function returns true, this function is supported on the device:
25666  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25667  This operation is atomic.
25668  Preconditions:
25669  None.
25670  Parameters:
25671  index - Identifier for the device instance
25672  Returns:
25673  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25674  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25675  Remarks:
25676  None.
25677 */
25678 
25679 bool
25681  SPI_MODULE_ID index ) ;
25682 //******************************************************************************
25683 /* Function:
25684  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25685  Summary:
25686  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25687  Description:
25688  This function identifies whether the FIFOInterruptMode feature is available
25689  on the SPI module.
25690  When this function returns true, this function is supported on the device:
25691  - PLIB_SPI_FIFOInterruptModeSelect
25692  This operation is atomic.
25693  Preconditions:
25694  None.
25695  Parameters:
25696  index - Identifier for the device instance
25697  Returns:
25698  - true - The FIFOInterruptMode feature is supported on the device
25699  - false - The FIFOInterruptMode feature is not supported on the device
25700  Remarks:
25701  None.
25702 */
25703 
25704 bool
25706  SPI_MODULE_ID index ) ;
25707 //******************************************************************************
25708 /* Function:
25709  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25710  Summary:
25711  Identifies whether the FramedCommunication feature exists on the SPI module.
25712  Description:
25713  This function identifies whether the FramedCommunication feature is available
25714  on the SPI module.
25715  When this function returns true, these functions are supported on the device:
25716  - PLIB_SPI_FramedCommunicationEnable
25717  - PLIB_SPI_FramedCommunicationDisable
25718  This operation is atomic.
25719  Preconditions:
25720  None.
25721  Parameters:
25722  index - Identifier for the device instance
25723  Returns:
25724  - true - The FramedCommunication feature is supported on the device
25725  - false - The FramedCommunication feature is not supported on the device
25726  Remarks:
25727  None.
25728 */
25729 
25730 bool
25732  SPI_MODULE_ID index ) ;
25733 //******************************************************************************
25734 /* Function:
25735  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25736  Summary:
25737  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25738  Description:
25739  This function identifies whether the FrameSyncPulseDirection feature is available
25740  on the SPI module.
25741  When this function returns true, this function is supported on the device:
25742  - PLIB_SPI_FrameSyncPulseDirectionSelect
25743  This operation is atomic.
25744  Preconditions:
25745  None.
25746  Parameters:
25747  index - Identifier for the device instance
25748  Returns:
25749  - true - The FrameSyncPulseDirection feature is supported on the device
25750  - false - The FrameSyncPulseDirection feature is not supported on the device
25751  Remarks:
25752  None.
25753 */
25754 
25755 bool
25757  SPI_MODULE_ID index ) ;
25758 //******************************************************************************
25759 /* Function:
25760  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25761  Summary:
25762  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25763  Description:
25764  This function identifies whether the FrameSyncPulsePolarity feature is available
25765  on the SPI module.
25766  When this function returns true, this function is supported on the device:
25767  - PLIB_SPI_FrameSyncPulsePolaritySelect
25768  This operation is atomic.
25769  Preconditions:
25770  None.
25771  Parameters:
25772  index - Identifier for the device instance
25773  Returns:
25774  - true - The FrameSyncPulsePolarity feature is supported on the device
25775  - false - The FrameSyncPulsePolarity feature is not supported on the device
25776  Remarks:
25777  None.
25778 */
25779 
25780 bool
25782  SPI_MODULE_ID index ) ;
25783 //******************************************************************************
25784 /* Function:
25785  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25786  Summary:
25787  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25788  Description:
25789  This function identifies whether the FrameSyncPulseEdge feature is available
25790  on the SPI module.
25791  When this function returns true, this function is supported on the device:
25792  - PLIB_SPI_FrameSyncPulseEdgeSelect
25793  This operation is atomic.
25794  Preconditions:
25795  None.
25796  Parameters:
25797  index - Identifier for the device instance
25798  Returns:
25799  - true - The FrameSyncPulseEdge feature is supported on the device
25800  - false - The FrameSyncPulseEdge feature is not supported on the device
25801  Remarks:
25802  None.
25803 */
25804 
25805 bool
25807  SPI_MODULE_ID index ) ;
25808 //******************************************************************************
25809 /* Function:
25810  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25811  Summary:
25812  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25813  Description:
25814  This function identifies whether the FrameSyncPulseWidth feature is available
25815  on the SPI module.
25816  When this function returns true, this function is supported on the device:
25817  - PLIB_SPI_FrameSyncPulseWidthSelect
25818  This operation is atomic.
25819  Preconditions:
25820  None.
25821  Parameters:
25822  index - Identifier for the device instance
25823  Returns:
25824  - true - The FrameSyncPulseWidth feature is supported on the device
25825  - false - The FrameSyncPulseWidth feature is not supported on the device
25826  Remarks:
25827  None.
25828 */
25829 
25830 bool
25832  SPI_MODULE_ID index ) ;
25833 //******************************************************************************
25834 /* Function:
25835  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25836  Summary:
25837  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25838  Description:
25839  This function identifies whether the FrameSyncPulseCounter feature is available
25840  on the SPI module.
25841  When this function returns true, this function is supported on the device:
25842  - PLIB_SPI_FrameSyncPulseCounterSelect
25843  This operation is atomic.
25844  Preconditions:
25845  None.
25846  Parameters:
25847  index - Identifier for the device instance
25848  Returns:
25849  - true - The FrameSyncPulseCounter feature is supported on the device
25850  - false - The FrameSyncPulseCounter feature is not supported on the device
25851  Remarks:
25852  None.
25853 */
25854 
25855 bool
25857  SPI_MODULE_ID index ) ;
25858 //******************************************************************************
25859 /* Function:
25860  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25861  Summary:
25862  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25863  Description:
25864  This function identifies whether the FrameErrorStatus feature is available on
25865  the SPI module.
25866  When this function returns true, these functions are supported on the device:
25867  - PLIB_SPI_FrameErrorStatusGet
25868  - PLIB_SPI_FrameErrorStatusClear
25869  This operation is atomic.
25870  Preconditions:
25871  None.
25872  Parameters:
25873  index - Identifier for the device instance
25874  Returns:
25875  - true - The FrameErrorStatus feature is supported on the device
25876  - false - The FrameErrorStatus feature is not supported on the device
25877  Remarks:
25878  None.
25879 */
25880 
25881 bool
25883  SPI_MODULE_ID index ) ;
25884 //******************************************************************************
25885 /* Function:
25886  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25887  Summary:
25888  Identifies whether the Buffer feature exists on the SPI module.
25889  Description:
25890  This function identifies whether the Buffer feature is available on the SPI module.
25891  When this function returns true, these functions are supported on the device:
25892  - PLIB_SPI_BufferClear
25893  - PLIB_SPI_BufferRead
25894  - PLIB_SPI_BufferWrite
25895  - PLIB_SPI_BufferAddressGet
25896  This operation is atomic.
25897  Preconditions:
25898  None.
25899  Parameters:
25900  index - Identifier for the device instance
25901  Returns:
25902  - true - The Buffer feature is supported on the device
25903  - false - The Buffer feature is not supported on the device
25904  Remarks:
25905  None.
25906 */
25907 
25908 bool
25910  SPI_MODULE_ID index ) ;
25911 //******************************************************************************
25912 /* Function:
25913  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
25914  Summary:
25915  Identifies whether the BaudRateClock feature exists on the SPI module.
25916  Description:
25917  This function identifies whether the BaudRateClock feature is available on
25918  the SPI module.
25919  When this function returns true, this function is supported on the device:
25920  - PLIB_SPI_BaudRateClockSelect
25921  This operation is atomic.
25922  Preconditions:
25923  None.
25924  Parameters:
25925  index - Identifier for the device instance
25926  Returns:
25927  - true - The BaudRateClock feature is supported on the device
25928  - false - The BaudRateClock feature is not supported on the device
25929  Remarks:
25930  None.
25931 */
25932 
25933 bool
25935  SPI_MODULE_ID index ) ;
25936 //******************************************************************************
25937 /* Function:
25938  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
25939  Summary:
25940  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
25941  Description:
25942  This function identifies whether the ErrorInterruptControl feature is available
25943  on the SPI module.
25944  When this function returns true, these functions are supported on the device:
25945  - PLIB_SPI_ErrorInterruptEnable
25946  - PLIB_SPI_ErrorInterruptDisable
25947  This operation is atomic.
25948  Preconditions:
25949  None.
25950  Parameters:
25951  index - Identifier for the device instance
25952  Returns:
25953  - true - The ErrorInterruptControl feature is supported on the device
25954  - false - The ErrorInterruptControl feature is not supported on the device
25955  Remarks:
25956  None.
25957 */
25958 
25959 bool
25961  SPI_MODULE_ID index ) ;
25962 //******************************************************************************
25963 /* Function:
25964  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
25965  Summary:
25966  Identifies whether the AudioErrorControl feature exists on the SPI module.
25967  Description:
25968  This function identifies whether the AudioErrorControl feature is available
25969  on the SPI module.
25970  When this function returns true, these functions are supported on the device:
25971  - PLIB_SPI_AudioErrorEnable
25972  - PLIB_SPI_AudioErrorDisable
25973  This operation is atomic.
25974  Preconditions:
25975  None.
25976  Parameters:
25977  index - Identifier for the device instance
25978  Returns:
25979  - true - The AudioErrorControl feature is supported on the device
25980  - false - The AudioErrorControl feature is not supported on the device
25981  Remarks:
25982  None.
25983 */
25984 
25985 bool
25987  SPI_MODULE_ID index ) ;
25988 //******************************************************************************
25989 /* Function:
25990  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
25991  Summary:
25992  Identifies whether the AudioProtocolControl feature exists on the SPI module.
25993  Description:
25994  This function identifies whether the AudioProtocolControl feature is available
25995  on the SPI module.
25996  When this function returns true, this function is supported on the device:
25997  - PLIB_SPI_AudioProtocolEnable
25998  - PLIB_SPI_AudioProtocolDisable
25999  This operation is atomic.
26000  Preconditions:
26001  None.
26002  Parameters:
26003  index - Identifier for the device instance
26004  Returns:
26005  - true - The AudioProtocolControl feature is supported on the device
26006  - false - The AudioProtocolControl feature is not supported on the device
26007  Remarks:
26008  None.
26009 */
26010 
26011 bool
26013  SPI_MODULE_ID index ) ;
26014 //******************************************************************************
26015 /* Function:
26016  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26017  Summary:
26018  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26019  Description:
26020  This function identifies whether the AudioTransmitMode feature is available
26021  on the SPI module.
26022  When this function returns true, this function is supported on the device:
26023  - PLIB_SPI_AudioTransmitModeSelect
26024  This operation is atomic.
26025  Preconditions:
26026  None.
26027  Parameters:
26028  index - Identifier for the device instance
26029  Returns:
26030  - true - The AudioTransmitMode feature is supported on the device
26031  - false - The AudioTransmitMode feature is not supported on the device
26032  Remarks:
26033  None.
26034 */
26035 
26036 bool
26038  SPI_MODULE_ID index ) ;
26039 //******************************************************************************
26040 /* Function:
26041  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26042  Summary:
26043  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26044  Description:
26045  This function identifies whether the AudioProtocolMode feature is available
26046  on the SPI module.
26047  When this function returns true, this function is supported on the device:
26048  - PLIB_SPI_AudioProtocolModeSelect
26049  This operation is atomic.
26050  Preconditions:
26051  None.
26052  Parameters:
26053  index - Identifier for the device instance
26054  Returns:
26055  - true - The AudioProtocolMode feature is supported on the device
26056  - false - The AudioProtocolMode feature is not supported on the device
26057  Remarks:
26058  None.
26059 */
26060 
26061 bool
26063  SPI_MODULE_ID index ) ;
26064 //******************************************************************************
26065 /* Function:
26066  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26067  Summary:
26068  Identifies whether the Buffer32bit feature exists on the SPI module.
26069  Description:
26070  This function identifies whether the Buffer32bit feature is available on the
26071  SPI module.
26072  When this function returns true, these functions are supported on the device:
26073  - PLIB_SPI_BufferRead32bit
26074  - PLIB_SPI_BufferWrite32bit
26075  This operation is atomic.
26076  Preconditions:
26077  None.
26078  Parameters:
26079  index - Identifier for the device instance
26080  Returns:
26081  - true - The Buffer32bit feature is supported on the device
26082  - false - The Buffer32bit feature is not supported on the device
26083  Remarks:
26084  None.
26085 */
26086 
26087 bool
26089  SPI_MODULE_ID index ) ;
26090 //******************************************************************************
26091 /* Function:
26092  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26093  Summary:
26094  Identifies whether the Buffer16bit feature exists on the SPI module.
26095  Description:
26096  This function identifies whether the Buffer16bit feature is available on the
26097  SPI module.
26098  When this function returns true, these functions are supported on the device:
26099  - PLIB_SPI_BufferRead16bit
26100  - PLIB_SPI_BufferWrite16bit
26101  This operation is atomic.
26102  Preconditions:
26103  None.
26104  Parameters:
26105  index - Identifier for the device instance
26106  Returns:
26107  - true - The Buffer16bit feature is supported on the device
26108  - false - The Buffer16bit feature is not supported on the device
26109  Remarks:
26110  None.
26111 */
26112 
26113 bool
26115  SPI_MODULE_ID index ) ;
26116 //DOM-IGNORE-BEGIN
26117 //DOM-IGNORE-END
26118  // #ifndef _PLIB_SPI_H
26119 /*******************************************************************************
26120  End of File
26121  */
26122 
26123 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26124 /* CLOSE_FILE Include File */
26125 
26126  // SPI PLIB Header
26127 #include "system/common/sys_common.h" // Common System Service Definitions
26128 #include "system/common/sys_module.h" // Module/Driver Definitions
26129 #include "system/int/sys_int.h" // System Interrupt Definitions
26130 #include "system/clk/sys_clk.h"
26131 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26132  /* LDRA full path */
26133 // DOM-IGNORE-BEGIN
26134 // DOM-IGNORE-END
26135 // *****************************************************************************
26136 /* SPI Driver Buffer Handle
26137  Summary:
26138  Handle identifying a read or write buffer passed to the driver.
26139  Description:
26140  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26141  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26142  This handle is associated with the buffer passed into the function and
26143  it allows the application to track the completion of the data from (or into)
26144  that buffer. The buffer handle value returned from the "buffer add" function
26145  is returned back to the client by the "callback" function registered with
26146  the driver.
26147  The buffer handle assigned to a client request expires when the client has
26148  been notified of the completion of the buffer transfer (after event handler
26149  function that notifies the client returns) or after the buffer has been
26150  retired by the driver if no event handler callback was set.
26151  Remarks:
26152  None.
26153 */
26154 
26155 typedef
26156 uintptr_t
26158 // *****************************************************************************
26159 /* SPI Driver Invalid Buffer Handle
26160  Summary:
26161  Definition of an invalid buffer handle.
26162  Description:
26163  This is the definition of an invalid buffer handle. An invalid buffer handle
26164  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26165  function if the buffer add request was not successful.
26166  Remarks:
26167  None.
26168 */
26169 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26170 // *****************************************************************************
26171 /* SPI Driver Module Index Numbers
26172  Summary:
26173  SPI driver index definitions.
26174  Description:
26175  These constants provide the SPI driver index definitions.
26176  Remarks:
26177  These constants should be used in place of hard-coded numeric literals.
26178  These values should be passed into the DRV_SPI_Initialize and
26179  DRV_SPI_Open functions to identify the driver instance in use.
26180 */
26181 #define DRV_SPI_INDEX_0 0
26182 #define DRV_SPI_INDEX_1 1
26183 #define DRV_SPI_INDEX_2 2
26184 #define DRV_SPI_INDEX_3 3
26185 #define DRV_SPI_INDEX_4 4
26186 #define DRV_SPI_INDEX_5 5
26187 // *****************************************************************************
26188 /* SPI Driver Module Index Count
26189  Summary:
26190  Number of valid SPI driver indices.
26191  Description:
26192  This constant identifies the number of valid SPI driver indices.
26193  Remarks:
26194  This constant should be used in place of hard-coded numeric literals.
26195  This value is derived from device-specific header files defined as part
26196  of the peripheral libraries.
26197 */
26198 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26199 // *****************************************************************************
26200 /* SPI Clock Mode Selection
26201  Summary:
26202  Identifies the various clock modes of the SPI module.
26203  Description:
26204  This enumeration identifies the various clock modes of the SPI module.
26205  Remarks:
26206  None.
26207 */
26208 
26209 typedef
26210  enum
26211  {
26212  /* SPI Clock Mode 0:
26213  - Idle State of the clock is Low
26214  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26215  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26217  /*DOM-IGNORE-BEGIN*/
26218  = 0 /*DOM-IGNORE-END*/
26219  ,
26220  /* SPI Clock Mode 1:
26221  - Idle State of the clock is Low
26222  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26223  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26225  /*DOM-IGNORE-BEGIN*/
26226  = 1 /*DOM-IGNORE-END*/
26227  ,
26228  /* SPI Clock Mode 2:
26229  - Idle State of the clock is High
26230  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26231  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26233  /*DOM-IGNORE-BEGIN*/
26234  = 2 /*DOM-IGNORE-END*/
26235  ,
26236  /* SPI Clock Mode 3:
26237  - Idle State of the clock is High
26238  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26239  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26241  /*DOM-IGNORE-BEGIN*/
26242  = 3 /*DOM-IGNORE-END*/
26243  } DRV_SPI_CLOCK_MODE ;
26244 // *****************************************************************************
26245 /* SPI Buffer Type Selection
26246  Summary:
26247  Identifies the various buffer types of the SPI module.
26248  Description:
26249  This enumeration identifies the various buffer types of the SPI module.
26250  Remarks:
26251  None.
26252 */
26253 
26254 typedef
26255  enum
26256  {
26257  /* SPI Buffer Type Standard */
26259  /*DOM-IGNORE-BEGIN*/
26260  = 0 /*DOM-IGNORE-END*/
26261  ,
26262  /* SPI Enhanced Buffer Type */
26264  /*DOM-IGNORE-BEGIN*/
26265  = 1 /*DOM-IGNORE-END*/
26267 // *****************************************************************************
26268 /* SPI Protocols Enumeration
26269  Summary:
26270  Identifies the various protocols of the SPI module.
26271  Description:
26272  This enumeration identifies the various protocols of the SPI module.
26273  Remarks:
26274  None.
26275 */
26276 
26277 typedef
26278  enum
26279  {
26280  /* SPI Protocol Type Standard */
26282  /*DOM-IGNORE-BEGIN*/
26283  = 0 /*DOM-IGNORE-END*/
26284  ,
26285  /* SPI Protocol Type Framed */
26287  /*DOM-IGNORE-BEGIN*/
26288  = 1 /*DOM-IGNORE-END*/
26289  ,
26290  /*SPI Protocol Type Audio*/
26292  /*DOM-IGNORE-BEGIN*/
26293  = 2 /*DOM-IGNORE-END*/
26295 // *****************************************************************************
26296 /* SPI Driver Buffer Events
26297  Summary
26298  Identifies the possible events that can result from a buffer add request.
26299  Description
26300  This enumeration identifies the possible events that can result from a
26301  buffer add request caused by the client calling either
26302  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26303  Remarks:
26304  One of these values is passed in the "event" parameter of the event
26305  handling callback function that the client registered during buffer add
26306  requests.
26307 */
26308 
26309 typedef
26310  enum
26311  {
26312  /* Buffer is pending to get processed */
26314  /* Buffer is being processed */
26316  /* All data from or to the buffer was transferred successfully. */
26318  /* There was an error while processing the buffer transfer request. */
26321 // *****************************************************************************
26322 /* SPI Usage Modes Enumeration
26323  Summary:
26324  Identifies the various usage modes of the SPI module.
26325  Description:
26326  This enumeration identifies the various usage modes of the SPI module.
26327  Remarks:
26328  None.
26329 */
26330 
26331 typedef
26332  enum
26333  {
26334  /* SPI Mode Master */
26336  /*DOM-IGNORE-BEGIN*/
26337  = 0 /*DOM-IGNORE-END*/
26338  ,
26339  /* SPI Mode Slave */
26341  /*DOM-IGNORE-BEGIN*/
26342  = 1 /*DOM-IGNORE-END*/
26343  } DRV_SPI_MODE ;
26344 // *****************************************************************************
26345 /* SPI Task Modes Enumeration
26346  Summary:
26347  Identifies the various modes of how the tasks function will be run.
26348  Description:
26349  This enumeration identifies the various tasks mode
26350  Remarks:
26351  None.
26352 */
26353 
26354 typedef
26355  enum
26356  {
26357  /* Task is configured to run in polled mode */
26359  /*DOM-IGNORE-BEGIN*/
26360  = 0 /*DOM-IGNORE-END*/
26361  ,
26362  /* Task is configured to run in interrupt mode */
26364  /*DOM-IGNORE-BEGIN*/
26365  = 1 /*DOM-IGNORE-END*/
26366  } DRV_SPI_TASK_MODE ;
26367 // *****************************************************************************
26368 /* SPI Driver Buffer Event Handler Function Pointer
26369  Summary:
26370  Pointer to a SPI Driver Buffer Event handler function
26371  Description:
26372  This data type defines the required function signature for the SPI driver
26373  buffer event handling callback function. A client must register a pointer
26374  to a buffer event handling function who's function signature (parameter
26375  and return value types) match the types specified by this function pointer
26376  in order to receive buffer related event calls back from the driver.
26377  The parameters and return values and return value are described here and
26378  a partial example implementation is provided.
26379  Parameters:
26380  event - Identifies the type of event
26381  bufferHandle - Handle identifying the buffer to which the vent relates
26382  context - Value identifying the context of the application that
26383  registered the event handling function.
26384  Returns:
26385  None.
26386  Example:
26387  <code>
26388  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26389  DRV_SPI_BUFFER_HANDLE bufferHandle,
26390  uintptr_t context )
26391  {
26392  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26393  switch(event)
26394  {
26395  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26396  // Handle the completed buffer.
26397  break;
26398  case DRV_SPI_BUFFER_EVENT_ERROR:
26399  default:
26400  // Handle error.
26401  break;
26402  }
26403  }
26404  </code>
26405  Remarks:
26406  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26407  transferred successfully.
26408  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26409  not transferred successfully.
26410  The bufferHandle parameter contains the buffer handle of the buffer that
26411  failed.
26412  The context parameter contains the a handle to the client context,
26413  provided at the time the event handling function registration.
26414  This context handle value is passed back to the client as the "context"
26415  parameter. It can be any value necessary to identify the client context
26416  or instance (such as a pointer to the client's data) instance of the
26417  client that made the buffer add request.
26418  The event handler function executes in an interrupt context when the driver
26419  is configured for interrupt mode operation. It is recommended of the
26420  application to not perform process intensive operations with in this
26421  function.
26422 */
26423 
26424 typedef
26426 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26427 void * context ) ;
26428 // *****************************************************************************
26429 /* SPI Driver Initialization Data
26430  Summary:
26431  Defines the data required to initialize or reinitialize the SPI driver
26432  Description:
26433  This data type defines the data required to initialize or reinitialize the
26434  SPI driver. If the driver is built statically, the members of this data
26435  structure are statically over-ridden by static override definitions in the
26436  system_config.h file.
26437  Remarks:
26438  None.
26439 */
26440 
26441 typedef
26442 struct _DRV_SPI_INIT
26443 {
26444  /* System module initialization */
26445  SYS_MODULE_INIT moduleInit ;
26446  /* Identifies peripheral (PLIB-level) ID */
26447  SPI_MODULE_ID spiId ;
26448  /* SPI Task Mode Type*/
26450  /* SPI Usage Mode Type */
26452  /* Allow SPI to run when CPU goes to idle mode*/
26453  bool allowIdleRun ;
26454  /* SPI Protocol Type */
26456  /* SPI Slave Mode SSx Pin Select */
26457  bool spiSlaveSSPin ;
26458  /* Framed mode Sync Pulse*/
26459  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26460  /* Framed Mode pulse polarity*/
26461  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26462  /* Framed Mode Pulse Direction*/
26463  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26464  /* Framed mode Pulse Edge*/
26465  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26466  /* Framed Mode Pulse width */
26467  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26468  /* Audio mode transmit mode*/
26469  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26470  /* Audio mode protocol mode*/
26471  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26472  /* Communication Width */
26473  SPI_COMMUNICATION_WIDTH commWidth ;
26474  /* SPI clock source which generates required baud rate.
26475  It can be either PBCLK or Reference Clock */
26476  SPI_BAUD_RATE_CLOCK baudClockSource ;
26477  /* when Baud rate clock source is peripheral clock, then this element is
26478  used to define which peripheral bus clock is used for this particular
26479  SPI instance. */
26480  CLK_BUSES_PERIPHERAL spiClk ;
26481  /* Baud Rate Value */
26482  uint32_t baudRate ;
26483  /* SPI Buffer Type */
26485  /* SPI Clock mode */
26487  /* SPI Input Sample Phase Selection */
26488  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26489  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26490  INT_SOURCE txInterruptSource ;
26491  /* Receive Interrupt Source for SPI module */
26492  INT_SOURCE rxInterruptSource ;
26493  /* Error Interrupt Source for SPI module */
26494  INT_SOURCE errInterruptSource ;
26495  /* While using standard buffer and polled mode how many transfers to do
26496  before yielding to other tasks*/
26497  uint8_t numTrfsSmPolled ;
26498  /* Dummy byte value which will be used for dummy transmission */
26499  uint32_t dummyByteValue ;
26500  /* This is the buffer queue size. This is the maximum
26501  number of transfer requests that driver will queue. */
26502  uint8_t queueSize ;
26503  /* This controls the minimum number of jobs that the driver will be able
26504  to accept without running out of memory. The driver will reserve this
26505  number of jobs from the global SPI queue so that it will always be available*/
26506  uint8_t jobQueueReserveSize ;
26507  /* This callback is fired when an operation is about to start on the
26508  SPI bus. This allows the user to set any pins that need to be set.
26509  This callback may be called from an ISR so should not include OSAL
26510  calls. The context parameter is the same one passed into the
26511  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26512  */
26514  /* This callback is fired when an operation has just completed on the
26515  SPI bus. This allows the user to set any pins that need to be set.
26516  This callback may be called from an ISR so should not include OSAL
26517  calls. The context parameter is the same one passed into the
26518  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26519  */
26521 } DRV_SPI_INIT ;
26522 // *****************************************************************************
26523 /* SPI Driver Client Specific Configuration
26524  Summary:
26525  Defines the data that can be changed per client.
26526  Description:
26527  This data type defines the data can be configured per client. This data can
26528  be per client, and overrides the configuration data contained inside of
26529  DRV_SPI_INIT.
26530  Remarks:
26531  None.
26532 */
26533 
26534 typedef
26535 struct _DRV_SPI_CLIENT_DATA
26536 {
26537  /* Baud Rate Value */
26538  uint32_t baudRate ;
26539  /* This callback is fired when an operation is about to start on the
26540  SPI bus. This allows the user to set any pins that need to be set.
26541  This callback may be called from an ISR so should not include OSAL
26542  calls. The context parameter is the same one passed into the
26543  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26544  */
26546  /* This callback is fired when an operation has just completed on the
26547  SPI bus. This allows the user to set any pins that need to be set.
26548  This callback may be called from an ISR so should not include OSAL
26549  calls. The context parameter is the same one passed into the
26550  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26551  */
26554 //DOM-IGNORE-BEGIN
26555 //DOM-IGNORE-END
26556  // #ifndef _DRV_SPI_DEFINITIONS_H
26557 /*******************************************************************************
26558  End of File
26559 */
26560 
26561 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26562 /* CLOSE_FILE Include File */
26563 
26564 // DOM-IGNORE-BEGIN
26565 // DOM-IGNORE-END
26566 // *****************************************************************************
26567 // *****************************************************************************
26568 // Section: Interface Routines - System Level
26569 // *****************************************************************************
26570 // *****************************************************************************
26571 // *****************************************************************************
26572 /* Function:
26573  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26574  const SYS_MODULE_INIT * const init )
26575  Summary:
26576  Initializes the SPI instance for the specified driver index.
26577  <p><b>Implementation:</b> Static/Dynamic</p>
26578  Description:
26579  This routine initializes the SPI driver instance for the specified driver
26580  index, making it ready for clients to open and use it. The initialization
26581  data is specified by the 'init' parameter. The initialization may fail if the
26582  number of driver objects allocated are insufficient or if the specified
26583  driver instance is already initialized. The driver instance index is
26584  independent of the SPI module ID. For example, driver instance 0 can be
26585  assigned to SPI2. If the driver is built statically, then some of the
26586  initialization parameters are overridden by configuration macros. Refer to
26587  the description of the DRV_SPI_INIT data structure for more details on
26588  which members on this data structure are overridden.
26589  Precondition:
26590  None.
26591  Parameters:
26592  index - Identifier for the instance to be initialized. Please note this
26593  is not the SPI id. The hardware SPI id is set in the initialization
26594  structure. This is the index of the driver index to use.
26595  init - Pointer to a data structure containing any data necessary to
26596  initialize the driver. If this pointer is NULL, the driver
26597  uses the static initialization override macros for each
26598  member of the initialization data structure.
26599  Returns:
26600  - If successful - returns a valid handle to a driver instance object
26601  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26602  Example:
26603  <code>
26604  DRV_SPI_INIT init;
26605  SYS_MODULE_OBJ objectHandle;
26606  // Populate the SPI initialization structure
26607  init.spiId = SPI_ID_1,
26608  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26609  init.spiMode = DRV_SPI_MODE_MASTER,
26610  init.allowIdleRun = false,
26611  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26612  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26613  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26614  init.spiClk = CLK_BUS_PERIPHERAL_2,
26615  init.baudRate = 10000000,
26616  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26617  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26618  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26619  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26620  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26621  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26622  init.dummyByteValue = 0xFF,
26623  init.queueSize = 10,
26624  init.jobQueueReserveSize = 1,
26625  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26626  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26627  {
26628  // Handle error
26629  }
26630  </code>
26631  Remarks:
26632  This routine must be called before any other SPI routine is called.
26633  This routine should only be called once during system initialization
26634  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26635  instance. This routine will NEVER block for hardware access.
26636 */
26637 
26638 SYS_MODULE_OBJ
26640  const SYS_MODULE_INDEX index ,
26641  const SYS_MODULE_INIT * const init ) ;
26642 //*************************************************************************
26643 /* Function:
26644  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26645  Summary:
26646  Deinitializes the specified instance of the SPI driver module.
26647  <p><b>Implementation:</b> Static/Dynamic</p>
26648  Description:
26649  Deinitializes the specified instance of the SPI driver module,
26650  disabling its operation (and any hardware) and invalidates all of the
26651  internal data.
26652  Precondition:
26653  Function DRV_SPI_Initialize must have been called before calling this
26654  routine and a valid SYS_MODULE_OBJ must have been returned.
26655  Parameters:
26656  object - Driver object handle, returned from DRV_SPI_Initialize
26657  Returns:
26658  None.
26659  Example:
26660  <code>
26661  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26662  SYS_STATUS status;
26663  DRV_SPI_Deinitialize ( object );
26664  status = DRV_SPI_Status( object );
26665  if( SYS_MODULE_UNINITIALIZED == status )
26666  {
26667  // Check again later if you need to know
26668  // when the driver is deinitialized.
26669  }
26670  </code>
26671  Remarks:
26672  Once the Initialize operation has been called, the De-initialize
26673  operation must be called before the Initialize operation can be called
26674  again.
26675  This function will NEVER block waiting for hardware. If the operation
26676  requires time to allow the hardware to complete, this will be reported
26677  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26678  to find out when the module is in the ready state.
26679 */
26680 
26681 void
26683  SYS_MODULE_OBJ object ) ;
26684 //**************************************************************************
26685 /* Function:
26686  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26687  Summary:
26688  Provides the current status of the SPI driver module.
26689  <p><b>Implementation:</b> Static/Dynamic</p>
26690  Description:
26691  This function provides the current status of the SPI driver module.
26692  Precondition:
26693  The DRV_SPI_Initialize function must have been called before calling
26694  this function.
26695  Parameters:
26696  object - Driver object handle, returned from DRV_SPI_Initialize
26697  Returns:
26698  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26699  system level operation and cannot start another
26700  Example:
26701  <code>
26702  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26703  SYS_STATUS status;
26704  status = DRV_SPI_Status( object );
26705  if( SYS_STATUS_READY != status )
26706  {
26707  // Handle error
26708  }
26709  </code>
26710  Remarks:
26711  Any value greater than SYS_STATUS_READY is also a normal running state
26712  in which the driver is ready to accept new operations.
26713  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26714  deinitialized
26715  This value is less than SYS_STATUS_ERROR.
26716  This function can be used to determine when any of the driver's module
26717  level operations has completed.
26718  If the status operation returns SYS_STATUS_BUSY, the previous operation
26719  has not yet completed. Once the status operation returns
26720  SYS_STATUS_READY, any previous operations have completed.
26721  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26722  that is also an error state.
26723  This function will NEVER block waiting for hardware.
26724  If the Status operation returns an error value, the error may be
26725  cleared by calling the reinitialize operation. If that fails, the
26726  deinitialize operation will need to be called, followed by the
26727  initialize operation to return to normal operations.
26728 */
26729 
26730 SYS_STATUS
26731  DRV_SPI_Status (
26732  SYS_MODULE_OBJ object ) ;
26733 // *****************************************************************************
26734 /* Function:
26735  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26736  Summary:
26737  Maintains the driver's state machine and implements its ISR.
26738  <p><b>Implementation:</b> Static/Dynamic</p>
26739  Description:
26740  This routine is used to maintain the driver's internal state
26741  machine and implement its transmit ISR for interrupt-driven implementations.
26742  In polling mode, this function should be called from the SYS_Tasks()
26743  function. In interrupt mode, this function should be called in the transmit
26744  interrupt service routine of the USART that is associated with this USART
26745  driver hardware instance.
26746  Precondition:
26747  The DRV_SPI_Initialize routine must have been called for the specified
26748  SPI driver instance.
26749  Parameters:
26750  object - Object handle for the specified driver instance (returned from
26751  DRV_SPI_Initialize)
26752  Returns:
26753  None.
26754  Example:
26755  <code>
26756  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26757  while( true )
26758  {
26759  DRV_SPI_Tasks ( object );
26760  // Do other tasks
26761  }
26762  </code>
26763  Remarks:
26764  This function is normally not called directly by an application. It is
26765  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26766  ISR.
26767  This function may execute in an ISR context and will never block or access any
26768  resources that may cause it to block.
26769 */
26770 
26771 void
26772  DRV_SPI_Tasks (
26773  SYS_MODULE_OBJ object ) ;
26774 // *****************************************************************************
26775 // *****************************************************************************
26776 // Section: Interface Routines - Client Level
26777 // *****************************************************************************
26778 // *****************************************************************************
26779 //**************************************************************************
26780 /* Function:
26781  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26782  const DRV_IO_INTENT ioIntent )
26783  Summary:
26784  Opens the specified SPI driver instance and returns a handle to it.
26785  <p><b>Implementation:</b> Static/Dynamic</p>
26786  Description:
26787  This routine opens the specified SPI driver instance and provides a
26788  handle that must be provided to all other client-level operations to
26789  identify the caller and the instance of the driver. The ioIntent
26790  parameter defines how the client interacts with this driver instance.
26791  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26792  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26793  able to write to the driver. If the ioIntent in
26794  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26795  write.
26796  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26797  exclusive access to this client. The driver cannot be opened by any
26798  other client.
26799  Precondition:
26800  The DRV_SPI_Initialize function must have been called before calling
26801  this function.
26802  Parameters:
26803  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26804  Please note this is not the SPI ID.
26805  ioIntent - Zero or more of the values from the enumeration
26806  DRV_IO_INTENT ORed together to indicate the intended use of
26807  the driver
26808  Returns:
26809  If successful, the routine returns a valid open-instance handle (a
26810  number identifying both the caller and the module instance).
26811  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26812  can occur when the following is true:
26813  * if the number of client objects allocated via
26814  DRV_SPI_INSTANCES_NUMBER is insufficient
26815  * if the client is trying to open the driver but driver has been
26816  opened exclusively by another client
26817  * if the driver hardware instance being opened is not initialized or
26818  is invalid
26819  Example:
26820  <code>
26821  DRV_HANDLE handle;
26822  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26823  if( DRV_HANDLE_INVALID == handle )
26824  {
26825  // Unable to open the driver
26826  }
26827  </code>
26828  Remarks:
26829  The handle returned is valid until the DRV_SPI_Close routine is
26830  called. This routine will NEVER block waiting for hardware. If the
26831  requested intent flags are not supported, the routine will return
26832  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26833  It should not be called in an ISR.
26834 */
26835 
26836 DRV_HANDLE
26837  DRV_SPI_Open (
26838  const SYS_MODULE_INDEX drvIndex ,
26839  const DRV_IO_INTENT ioIntent ) ;
26840 //**************************************************************************
26841 /* Function:
26842  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26843  const DRV_SPI_CLIENT_DATA * cfgData )
26844  Summary:
26845  Configures a SPI client with specific data.
26846  <p><b>Implementation:</b> Static/Dynamic</p>
26847  Description:
26848  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26849  Whenever a new SPI job is started these values will be used. Passing in NULL will
26850  reset the client back to configuration parameters passed to driver initialization.
26851  A zero in any of the structure elements will reset that specific configuration back
26852  to the driver default.
26853  Precondition:
26854  The DRV_SPI_Open function must have been called before calling
26855  this function.
26856  Parameters:
26857  handle - handle of the client returned by DRV_SPI_Open.
26858  cfgData - Client-specific configuration data.
26859  Returns:
26860  - If successful - the routing will return greater than or equal to zero
26861  - If an error occurs - the return value is negative
26862 */
26863 
26864 int32_t
26866  DRV_HANDLE handle ,
26867  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26868 // *****************************************************************************
26869 /* Function:
26870  void DRV_SPI_Close ( DRV_HANDLE handle )
26871  Summary:
26872  Closes an opened instance of the SPI driver.
26873  <p><b>Implementation:</b> Static/Dynamic</p>
26874  Description:
26875  This function closes an opened instance of the SPI driver, invalidating the
26876  handle.
26877  Precondition:
26878  The DRV_SPI_Initialize routine must have been called for the specified
26879  SPI driver instance.
26880  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26881  Parameters:
26882  handle - A valid open-instance handle, returned from the driver's
26883  open routine
26884  Returns:
26885  None.
26886  Example:
26887  <code>
26888  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26889  DRV_SPI_Close ( handle );
26890  </code>
26891  Remarks:
26892  After calling this routine, the handle passed in "handle" must not be used
26893  with any of the remaining driver routines. A new handle must be obtained by
26894  calling DRV_SPI_Open before the caller may use the driver again. This
26895  function is thread safe in a RTOS application.
26896  Note:
26897  Usually there is no need for the driver client to verify that the Close
26898  operation has completed.
26899 */
26900 
26901 void
26902  DRV_SPI_Close (
26903  DRV_HANDLE handle ) ;
26904 // *****************************************************************************
26905 // *****************************************************************************
26906 // Section: Interface Routines - Client level Read & Write APIs
26907 // *****************************************************************************
26908 // *****************************************************************************
26909 /* These are non-blocking APIs. It doesn't wait until the operation gets
26910  finished. The actual operation will happen it the task routine. The status of
26911  this operation can be monitored using DRV_SPI_BufferStatus function. In
26912  polling mode, User must ensure that the code gets time to execute the task
26913  routine. */
26914 //*******************************************************************************
26915 /* Function:
26916  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
26917  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26918  void * context )
26919  Summary:
26920  Registers a buffer for a read operation. Actual transfer will happen in
26921  the Task function.
26922  <p><b>Implementation:</b> Static/Dynamic</p>
26923  Description:
26924  Registers a buffer for a read operation. Actual transfer will happen in
26925  the Task function. The status of this operation can be monitored using
26926  DRV_SPI_BufferStatus function. A optional callback can also be
26927  provided that will be called when the operation is complete.
26928  Precondition:
26929  The DRV_SPI_Initialize routine must have been called for the specified
26930  SPI driver instance.
26931  DRV_SPI_Open must have been called to obtain a valid opened device
26932  handle.
26933  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
26934  in the DRV_SPI_Open call.
26935  Parameters:
26936  handle - A valid open-instance handle, returned from the driver's
26937  open routine
26938  rxBuffer - The buffer to which the data should be written to.
26939  size - Number of bytes to be read from the SPI bus.
26940  completeCB - Pointer to a function to be called when this queued operation is complete.
26941  context - unused by the driver but this is passed to the callback when it is called.
26942  Returns:
26943  If the buffer add request is successful, a valid buffer handle is returned.
26944  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26945  Example:
26946  <code>
26947  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26948  char myBuffer[MY_BUFFER_SIZE], state = 0;
26949  DRV_SPI_BUFFER_HANDLE bufferHandle;
26950  switch ( state )
26951  {
26952  case 0:
26953  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
26954  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
26955  {
26956  state++;
26957  }
26958  break;
26959  case 1:
26960  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
26961  {
26962  state++;
26963  // All transmitter data has been sent successfully.
26964  }
26965  break;
26966  }
26967  </code>
26968  Remarks:
26969  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
26970  instead of it.
26971  */
26972 
26975  DRV_HANDLE handle ,
26976  void * rxBuffer ,
26977  size_t size ,
26978  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
26979  void * context ) ;
26980 //*******************************************************************************
26981 /* Function:
26982  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
26983  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26984  void * context )
26985  Summary:
26986  Registers a buffer for a write operation. Actual transfer will happen
26987  in the Task function.
26988  <p><b>Implementation:</b> Static/Dynamic</p>
26989  Description:
26990  Registers a buffer for a write operation. Actual transfer will happen
26991  in the Task function. The status of this operation can be monitored
26992  using DRV_SPI_BufferStatus function. A optional callback can also be
26993  provided that will be called when the operation is complete.
26994  Precondition:
26995  The DRV_SPI_Initialize routine must have been called for the specified
26996  SPI driver instance.
26997  DRV_SPI_Open must have been called to obtain a valid opened device
26998  handle.
26999  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27000  in the DRV_SPI_Open call.
27001  Parameters:
27002  handle - A valid open-instance handle, returned from the driver's
27003  open routine
27004  txBuffer - The buffer which hold the data.
27005  size - Number of bytes to be written to the SPI bus.
27006  completeCB - Pointer to a function to be called when this queued operation is complete
27007  context - unused by the driver but this is passed to the callback when it is called
27008  Returns:
27009  If the buffer add request is successful, a valid buffer handle is returned.
27010  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27011  Example:
27012  <code>
27013  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27014  char myBuffer[MY_BUFFER_SIZE], state = 0;
27015  DRV_SPI_BUFFER_HANDLE bufferHandle;
27016  switch ( state )
27017  {
27018  case 0:
27019  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27020  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27021  {
27022  state++;
27023  }
27024  break;
27025  case 1:
27026  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27027  {
27028  state++;
27029  // All transmitter data has been sent successfully.
27030  }
27031  break;
27032  }
27033  </code>
27034  Remarks:
27035  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27036  instead of it.
27037 */
27038 
27041  DRV_HANDLE handle ,
27042  void * txBuffer ,
27043  size_t size ,
27044  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27045  void * context ) ;
27046 //*******************************************************************************
27047 /* Function:
27048  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27049  void *txBuffer, void *rxBuffer, size_t size, )
27050  Summary:
27051  Registers a buffer for a read and write operation. Actual transfer will
27052  happen in the Task function.
27053  <p><b>Implementation:</b> Static/Dynamic</p>
27054  Description:
27055  Registers a buffer for a read and write operation. Actual transfer will
27056  happen in the Task function. The status of this operation can be
27057  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27058  provided that will be called when the operation is complete.
27059  Precondition:
27060  The DRV_SPI_Initialize routine must have been called for the specified
27061  SPI driver instance.
27062  DRV_SPI_Open must have been called to obtain a valid opened device
27063  handle.
27064  Parameters:
27065  handle - A valid open-instance handle, returned from the driver's
27066  open routine
27067  txBuffer - The buffer which hold the data.
27068  txSize - Number of bytes to be written to the SPI bus.
27069  rxBuffer - The buffer to which the data should be written to.
27070  rxSize - Number of bytes to be read from the SPI bus
27071  completeCB - Pointer to a function to be called when this queued operation is complete
27072  context - unused by the driver but this is passed to the callback when it is called
27073  Returns:
27074  If the buffer add request is successful, a valid buffer handle is returned.
27075  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27076  Example:
27077  <code>
27078  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27079  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27080  DRV_SPI_BUFFER_HANDLE bufferHandle;
27081  switch ( state )
27082  {
27083  case 0:
27084  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27085  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27086  {
27087  state++;
27088  }
27089  break;
27090  case 1:
27091  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27092  {
27093  state++;
27094  // All transmitter data has been sent successfully.
27095  }
27096  break;
27097  }
27098  </code>
27099  Remarks:
27100  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27101  instead of it.
27102 */
27103 
27106  DRV_HANDLE handle ,
27107  void * txBuffer ,
27108  size_t txSize ,
27109  void * rxBuffer ,
27110  size_t rxSize ,
27111  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27112  void * context ) ;
27113 //*******************************************************************************
27114 /* Function:
27115  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27116  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27117  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27118  Summary:
27119  Registers a buffer for a read operation. Actual transfer will happen in
27120  the Task function.
27121  <p><b>Implementation:</b> Static/Dynamic</p>
27122  Description:
27123  Registers a buffer for a read operation. Actual transfer will happen in
27124  the Task function. The status of this operation can be monitored using
27125  DRV_SPI_BufferStatus function. A optional callback can also be
27126  provided that will be called when the operation is complete.
27127  Precondition:
27128  The DRV_SPI_Initialize routine must have been called for the specified
27129  SPI driver instance.
27130  DRV_SPI_Open must have been called to obtain a valid opened device
27131  handle.
27132  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27133  in the DRV_SPI_Open call.
27134  Parameters:
27135  handle - A valid open-instance handle, returned from the driver's
27136  open routine
27137  rxBuffer - The buffer to which the data should be written to.
27138  size - Number of bytes to be read from the SPI bus.
27139  completeCB - Pointer to a function to be called when this queued operation is complete
27140  context - unused by the driver but this is passed to the callback when it is called
27141  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27142  Returns:
27143  If the buffer add request is successful, a valid buffer handle is returned.
27144  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27145  Example:
27146  <code>
27147  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27148  char myBuffer[MY_BUFFER_SIZE], state = 0;
27149  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27150  switch ( state )
27151  {
27152  case 0:
27153  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27154  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27155  {
27156  state++;
27157  }
27158  break;
27159  case 1:
27160  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27161  {
27162  state++;
27163  // All transmitter data has been sent successfully.
27164  }
27165  break;
27166  }
27167  </code>
27168  Remarks:
27169  None.
27170  */
27171 
27174  DRV_HANDLE handle ,
27175  void * rxBuffer ,
27176  size_t size ,
27177  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27178  void * context ,
27179  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27180 //*******************************************************************************
27181 /* Function:
27182  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27183  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27184  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27185  Summary:
27186  Registers a buffer for a write operation. Actual transfer will happen
27187  in the Task function.
27188  <p><b>Implementation:</b> Static/Dynamic</p>
27189  Description:
27190  Registers a buffer for a write operation. Actual transfer will happen
27191  in the Task function. The status of this operation can be monitored
27192  using DRV_SPI_BufferStatus function. A optional callback can also be
27193  provided that will be called when the operation is complete.
27194  Precondition:
27195  The DRV_SPI_Initialize routine must have been called for the specified
27196  SPI driver instance.
27197  DRV_SPI_Open must have been called to obtain a valid opened device
27198  handle.
27199  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27200  in the DRV_SPI_Open call.
27201  Parameters:
27202  handle - A valid open-instance handle, returned from the driver's
27203  open routine
27204  txBuffer - The buffer which hold the data.
27205  size - Number of bytes to be written to the SPI bus.
27206  completeCB - Pointer to a function to be called when this queued operation is complete
27207  context - unused by the driver but this is passed to the callback when it is called
27208  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27209  Returns:
27210  If the buffer add request is successful, a valid buffer handle is returned.
27211  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27212  Example:
27213  <code>
27214  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27215  char myBuffer[MY_BUFFER_SIZE], state = 0;
27216  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27217  switch ( state )
27218  {
27219  case 0:
27220  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27221  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27222  {
27223  state++;
27224  }
27225  break;
27226  case 1:
27227  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27228  {
27229  state++;
27230  // All transmitter data has been sent successfully.
27231  }
27232  break;
27233  }
27234  </code>
27235  Remarks:
27236  None.
27237 */
27238 
27241  DRV_HANDLE handle ,
27242  void * txBuffer ,
27243  size_t size ,
27244  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27245  void * context ,
27246  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27247 //*******************************************************************************
27248 /* Function:
27249  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27250  void *txBuffer, void *rxBuffer, size_t size,
27251  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27252  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27253  Summary:
27254  Registers a buffer for a read and write operation. Actual transfer will
27255  happen in the Task function.
27256  <p><b>Implementation:</b> Static/Dynamic</p>
27257  Description:
27258  Registers a buffer for a read and write operation. Actual transfer will
27259  happen in the Task function. The status of this operation can be
27260  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27261  provided that will be called when the operation is complete.
27262  Precondition:
27263  The DRV_SPI_Initialize routine must have been called for the specified
27264  SPI driver instance.
27265  DRV_SPI_Open must have been called to obtain a valid opened device
27266  handle.
27267  Parameters:
27268  handle - A valid open-instance handle, returned from the driver's
27269  open routine
27270  txBuffer - The buffer which hold the data.
27271  txSize - Number of bytes to be written to the SPI bus.
27272  rxBuffer - The buffer to which the data should be written to.
27273  rxSize - Number of bytes to be read from the SPI bus
27274  completeCB - Pointer to a function to be called when this queued operation is complete
27275  context - unused by the driver but this is passed to the callback when it is called
27276  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27277  Returns:
27278  If the buffer add request is successful, a valid buffer handle is returned.
27279  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27280  Example:
27281  <code>
27282  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27283  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27284  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27285  switch ( state )
27286  {
27287  case 0:
27288  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27289  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27290  {
27291  state++;
27292  }
27293  break;
27294  case 1:
27295  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27296  {
27297  state++;
27298  // All transmitter data has been sent successfully.
27299  }
27300  break;
27301  }
27302  </code>
27303  Remarks:
27304  None.
27305 */
27306 
27309  DRV_HANDLE handle ,
27310  void * txBuffer ,
27311  size_t txSize ,
27312  void * rxBuffer ,
27313  size_t rxSize ,
27314  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27315  void * context ,
27316  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27317 // *****************************************************************************
27318 /* Function:
27319  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27320  Summary:
27321  Returns the transmitter and receiver transfer status.
27322  <p><b>Implementation:</b> Static/Dynamic</p>
27323  Description:
27324  This returns the transmitter and receiver transfer status.
27325  Precondition:
27326  The DRV_SPI_Initialize routine must have been called for the specified
27327  SPI driver instance.
27328  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27329  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27330  the buffer handle associated with that transfer.
27331  Parameters:
27332  bufferHandle - A valid buffer handle, returned from the driver's
27333  data transfer routine
27334  Returns:
27335  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27336  transfer.
27337  Example:
27338  <code>
27339  // Buffer handle returned from the data transfer function
27340  DRV_SPI_BUFFER_HANDLE bufferHandle;
27341  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27342  {
27343  // All transmitter data has been sent.
27344  }
27345  </code>
27346  Remarks:
27347  The returned status may contain a value with more than one of the bits
27348  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27349  should perform an AND with the bit of interest and verify if the
27350  result is non-zero (as shown in the example) to verify the desired status
27351  bit.
27352 */
27353 
27356  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27357 // *****************************************************************************
27358 /* Function:
27359  bool DRV_SPIn_ReceiverBufferIsFull(void)
27360  Summary:
27361  Returns the receive buffer status. 'n' represents the instance of the
27362  SPI driver used.
27363  <p><b>Implementation:</b> Static</p>
27364  Description:
27365  This function returns the receive buffer status (full/empty).
27366  Precondition:
27367  None.
27368  Parameters:
27369  None.
27370  Returns:
27371  Receive Buffer Status
27372  - 1 - Full
27373  - 0 - Empty
27374  Example:
27375  <code>
27376  bool rxBufStat;
27377  // Using instance 1 of SPI driver, that is n = 1
27378  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27379  if (rxBufStat)
27380  {
27381  ...
27382  }
27383  </code>
27384  Remarks:
27385  None.
27386 */
27387 
27388 bool
27390 // *****************************************************************************
27391 /* Function:
27392  bool DRV_SPIn_TransmitterBufferIsFull(void)
27393  Summary:
27394  Returns the transmit buffer status. 'n' represents the instance of the
27395  SPI driver used.
27396  <p><b>Implementation:</b> Static</p>
27397  Description:
27398  This function returns the transmit buffer status (full/empty).
27399  Precondition:
27400  None.
27401  Parameters:
27402  None.
27403  Returns:
27404  Transmit Buffer Status
27405  - 1 - Full
27406  - 0 - Empty
27407  Example:
27408  <code>
27409  bool txBufStat;
27410  // Using instance 1 of SPI driver, that is n = 1
27411  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27412  if (txBufStat)
27413  {
27414  ...
27415  }
27416  </code>
27417  Remarks:
27418  None.
27419 */
27420 
27421 bool
27423 //DOM-IGNORE-BEGIN
27424 //DOM-IGNORE-END
27425  // #ifndef _DRV_SPI_H
27426 /*******************************************************************************
27427  End of File
27428 */
27429 
27430 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27431 /* CLOSE_FILE Include File */
27432 
27433 #include "driver/usb/usbhs/drv_usbhs.h"
27434 #include "usb/usb_device.h"
27435 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27436 /**************************************************************************************/
27437 /* LDRA_INSPECTED 110 S
27438 */
27454 /**************************************************************************************/
27455 #ifndef APP_H /* Guard against multiple inclusion.*/
27456 #define APP_H
27457 /**************************************************************************************/
27458 /* ************************************************************************************/
27459 /* Section: Included Files */
27460 /**************************************************************************************/
27461 /**************************************************************************************/
27462 #include <stdint.h>
27463 /**************************************************************************************/
27464 /**************************************************************************************/
27465 /* Section: Data Types */
27466 /**************************************************************************************/
27467 /**************************************************************************************/
27468 /**************************************************************************************/
27469 /* APP_DATA
27470  Summary:
27471  Holds APP_DATA used for the APP tasks.
27472  Description:
27473  Holds APP_DATA used for the APP tasks. The variables
27474  used are stored here.
27475  Remarks:
27476  None
27477  */
27478 
27479 typedef
27480  struct
27481  {
27482  uint8_t RevNumber ;
27483  } APP_DATA ;
27484 
27485 extern APP_DATA
27486  APP ;
27487 /**************************************************************************************/
27488 /**************************************************************************************/
27489 /* Section: Application Initialization and State Machine Functions */
27490 /**************************************************************************************/
27491 /**************************************************************************************/
27492 /*!*************************************************************************************
27493  Function:
27494  void APP_Initialize(void)
27495  Summary:
27496  Autonomous tool application initialization routine.
27497  Description:
27498  This function initializes the application. It places the
27499  application in its initial state and prepares it to run so that its
27500  APP_Tasks function can be called.
27501  Precondition:
27502  All other system initialization routines should be called before calling
27503  this routine (in "SYS_Initialize").
27504  Parameters:
27505  None.
27506  Returns:
27507  None.
27508  Example:
27509  APP_Initialize()
27510  Remarks:
27511  This routine must be called from the main function.
27512 */
27513 
27514 void
27515  APP_Initialize ( void ) ;
27516 /*!*************************************************************************************
27517  Function:
27518  void APP_Tasks(void)
27519  Summary:
27520  Application tasks function
27521  Description:
27522  This function is the main application's tasks function. It contains the various
27523  tasks that are maintained during the operation of the shooting panel.
27524  Precondition:
27525  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27526  should be called before calling this.
27527  Parameters:
27528  None.
27529  Returns:
27530  None.
27531  Example:
27532  APP_Tasks()
27533  Remarks:
27534  This routine must be called from the main() routine.
27535  */
27536 
27537 void
27538  APP_Tasks ( void ) ;
27539  /* APP_H */
27540 /***************************************************************************************
27541  End of File
27542  */
27543 
27544 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27545 /* CLOSE_FILE Include File */
27546 
27547 // DOM-IGNORE-BEGIN
27548 // DOM-IGNORE-END
27549 // *****************************************************************************
27550 // *****************************************************************************
27551 // Section: Type Definitions
27552 // *****************************************************************************
27553 // *****************************************************************************
27554 // *****************************************************************************
27555 /* System Objects
27556  Summary:
27557  Structure holding the system's object handles
27558  Description:
27559  This structure contains the object handles for all objects in the
27560  MPLAB Harmony project's system configuration.
27561  Remarks:
27562  These handles are returned from the "Initialize" functions for each module
27563  and must be passed into the "Tasks" function for each module.
27564 */
27565 
27566 typedef
27567  struct
27568  {
27569  SYS_MODULE_OBJ sysTmr ;
27570  SYS_MODULE_OBJ drvTmr0 ;
27571  SYS_MODULE_OBJ drvTmr1 ;
27572  SYS_MODULE_OBJ drvTmr2 ;
27573  SYS_MODULE_OBJ drvTmr3 ;
27574  SYS_MODULE_OBJ drvTmr4 ;
27575  SYS_MODULE_OBJ drvUsart0 ;
27576  SYS_MODULE_OBJ drvPMP0 ;
27577  /*** SPI Object for Index 0 ***/
27578  SYS_MODULE_OBJ spiObjectIdx0 ;
27579  /*** SPI Object for Index 1 ***/
27580  SYS_MODULE_OBJ spiObjectIdx1 ;
27581  /*** SPI Object for Index 2 ***/
27582  SYS_MODULE_OBJ spiObjectIdx2 ;
27583  SYS_MODULE_OBJ drvUSBObject ;
27584  SYS_MODULE_OBJ usbDevObject0 ;
27585  } SYSTEM_OBJECTS ;
27586 // *****************************************************************************
27587 // *****************************************************************************
27588 // Section: extern declarations
27589 // *****************************************************************************
27590 // *****************************************************************************
27591 
27592 extern SYSTEM_OBJECTS
27593  sysObj ;
27594 //DOM-IGNORE-BEGIN
27595 //DOM-IGNORE-END
27596  /* _SYS_DEFINITIONS_H */
27597 /*******************************************************************************
27598  End of File
27599 */
27600 
27601 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27602 /* CLOSE_FILE Include File */
27603 
27604 /**************************************************************************************/
27605 /**************************************************************************************/
27606 /* Section: Data Types */
27607 /**************************************************************************************/
27608 /**************************************************************************************/
27609 
27610 typedef
27611 float
27613 /**************************************************************************************/
27614 /*FSK states
27615  Summary:
27616  FSK states enumeration
27617  Description:
27618  This enumeration defines the valid FSK states. These states
27619  determine the behavior of the FSK state machine at various times.
27620 */
27621 
27622 typedef
27623  enum
27624  {
27631  } FSK_STATES ;
27632 /**************************************************************************************/
27633 /* FSK_DATA
27634  Summary:
27635  Holds FSK_DATA used for the FSK tasks.
27636  Description:
27637  Holds FSK_DATA used for the FSK tasks. The state machine and variables
27638  used to control FSK functions are stored here.
27639  Remarks:
27640  None
27641  */
27642 
27643 typedef
27644  struct
27645  {
27646  FSK_STATES state ;
27647  uint8_t crc ;
27648  uint8_t null_count ;
27649  bool send_message_complete_flag ;
27650  bool tick ;
27651  float32_t baud ;
27652  float32_t fsk_timer_freq ;
27653  float32_t mark_count ;
27654  float32_t space_count ;
27655  float32_t TABLE_MOD [ 50 ] ;
27656  uint8_t table_count ;
27657  } FSK_DATA ;
27658 
27659 extern FSK_DATA
27660  FSK ;
27661  /**************************************************************************************/
27662 
27663 typedef
27664  union /* Union defining the PerfSwitch message component lengths.*/
27665  {
27666  uint32_t dword ;
27667  uint16_t word ;
27668  uint8_t byte [ 4 ] ;
27669  } TMultiValue ;
27670 
27671 extern TMultiValue
27672  MESSAGE ;
27673 /**************************************************************************************/
27674 /**************************************************************************************/
27675 /* DOWN_MSG Data
27676  Summary:
27677  Holds DOWN_MSG data used for the FSK tasks.
27678  Description:
27679  Holds DOWN_MSG data used for the FSK tasks. The variables used to control FSK
27680  message are stored here.
27681  Remarks:
27682  None
27683  */
27684 
27685 typedef
27686  struct /* Structure defining the components of the FSK message to a PerfSwitch.*/
27687  {
27688  uint8_t identifier ;
27689  uint8_t command ;
27690  uint8_t msg_length ;
27691  uint8_t xmit_ready_flag ;
27692  } DOWN_MSG ;
27693 
27694 extern DOWN_MSG
27695  DWNMSG ;
27696 /**************************************************************************************/
27697 /*MSG states
27698  Summary:
27699  MSG states enumeration
27700  Description:
27701  This enumeration defines the valid MSG states. These states
27702  determine the behavior of the MSG state machine at various times. This machine
27703  also controls access to the PRE_MSG state machine.
27704 */
27705 
27706 typedef
27707  enum
27708  {
27714  } MSG_STATES ;
27715 /**************************************************************************************/
27716 /* MSG_DATA
27717  Summary:
27718  Holds MSG_DATA used for the MSG tasks.
27719  Description:
27720  Holds MSG_DATA used for the MSG tasks. The state machine and variables
27721  used to control MSG functions are stored here.
27722  Remarks:
27723  None
27724  */
27725 
27726 typedef
27727  struct
27728  {
27729  MSG_STATES state ;
27730  uint32_t command ;
27731  uint8_t length ;
27732  } MSG_DATA ;
27733 
27734 extern MSG_DATA
27735  MSG ;
27736 /**************************************************************************************/
27737 /*PREAMBLE states
27738  Summary:
27739  PRE_MSG states enumeration
27740  Description:
27741  This enumeration defines the valid PREAMBLE states. These states
27742  determine the behavior of the PREAMBLE state machine at various times. This is
27743  accessed from the MSG_STATE machine.
27744 */
27745 
27746 typedef
27747  enum
27748  {
27755  } PREAMBLE_STATES ;
27756 /**************************************************************************************/
27757 /* PRE_DATA
27758  Summary:
27759  Holds PRE_MSG_DATA used for the PRE_MSG tasks.
27760  Description:
27761  Holds PRE_MSG_DATA used for the PRE_MSG tasks. The state machine and variables
27762  used to control PRE_MSG functions are stored here.
27763  Remarks:
27764  None
27765  */
27766 
27767 typedef
27768  struct
27769  {
27770  PREAMBLE_STATES state ;
27771  } PRE_DATA ;
27772 
27773 extern PRE_DATA
27774  PRE_MSG ;
27775 
27776 static const uint8_t
27777  Xmit11 [ 312 ] = /* Array for the FSK frequency generation for a 'Mark'.*/
27778  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
27779  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
27780  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
27781  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
27782  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
27783  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U
27784  , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U ,
27785  0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU
27786  , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU ,
27787  0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U
27788  , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
27789 
27790 static const uint8_t
27791  Xmit00 [ 168 ] = /* Array for the FSK frequency generation for a 'Space'.*/
27792  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
27793  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
27794  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
27795  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
27796  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
27797  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
27798 /**************************************************************************************/
27799 /**************************************************************************************/
27800 /* External Functions */
27801 /**************************************************************************************/
27802 /**************************************************************************************/
27803 /*!*************************************************************************************
27804  Function:
27805  void Prepare_Dwn_Msg( uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length )
27806  Summary:
27807  Receives information from the command parser and stores it into the DwnMsg (FSK)
27808  structure for transmission by FSK.
27809  Description:
27810  Receives information from the command parser and stores it into the DwnMsg (FSK)
27811  structure for transmission by FSK. No other action is performed on the data here.
27812  The DwnMsg (FSK) elements can be manipulated prior to the FSK transmission to
27813  create the final MESSAGE array for longer commands.
27814 
27815  Precondition:
27816  None.
27817  Parameters:
27818  uint8_t Identifier: The lower 3 bits of Frame 4 from the Protocol B command.
27819  uint8_t Cmd: Frame 0 from the Protocol B command.
27820  uint8_t msgLength: The FSK message length in bits.
27821  Returns
27822  None.
27823 
27824  Remarks
27825  None.
27826 
27827  Example:
27828  Prepare_Dwn_Msg(ident,cmd, 20)
27829  */
27830 
27831 void
27832  Prepare_Dwn_Msg (
27833  uint8_t Identifier ,
27834  uint8_t Cmd ,
27835  uint8_t Msg_Length ) ;
27836 /*!*************************************************************************************
27837  Function:
27838  void Generate_Sine_Wave_Data( float32_t NoOfTicks )
27839  Summary:
27840  This function stores sine wave inter step time values into two arrays at
27841  initialization and if the FSK frequency needs to be adjusted. These values
27842  represent the amount of time between updates of the sine wave data DAC used to
27843  generate a 1 or 0.
27844  Description:
27845  This function stores sine wave inter step time values into two arrays at
27846  initialization and if the FSK frequency needs to be adjusted. The TimeMark array
27847  is for the time between a 'MARK' update and the TimeSpace array is for the time
27848  between a 'SPACE' update. Changing the time between the updates will effectively
27849  change the transmitted frequency for a 'MARK' or 'SPACE'. This occurs if there
27850  are errors during the data transmission to a PerfSwitch. This can occur as the
27851  PerfSwitch gets hot when it is down hole.
27852 
27853  Precondition:
27854  None.
27855  Parameters:
27856  float32_t NoOfTicks: This is an error factor used to correct the inter step
27857  time values.
27858  Returns
27859  None.
27860 
27861  Remarks
27862  None.
27863 
27864  Example:
27865  void GenerateSineWaveData( float32_t NoOfTicks )
27866  */
27867 
27868 void
27870  float32_t NoOfTicks ) ;
27871 /**************************************************************************************/
27872 /**************************************************************************************/
27873 /* Local Functions */
27874 /**************************************************************************************/
27875 /**************************************************************************************/
27876 /*!*************************************************************************************
27877  Function:
27878  static void Init_FSK( void )
27879  Summary:
27880  Function to initialize the FSK parameters.
27881  Description:
27882  Function to initialize the FSK parameters. All of the flags and table data are
27883  set to their initial condition. Timer 2 is also started. It is set to 160nS and
27884  is used to count the time between the Manchester transitions.
27885 
27886  Precondition:
27887  None.
27888  Parameters:
27889  None.
27890  Returns:
27891  None.
27892 
27893  Remarks:
27894  None.
27895 
27896  Example:
27897  Init_FSK()
27898  */
27899 
27900 static void
27901  Init_FSK ( void ) ;
27902 /*!*************************************************************************************
27903  Function:
27904  static void Send_Space( void )
27905  Summary:
27906  This function sends a FSK 0 or 'SPACE'.
27907  Description:
27908  This function sends a FSK 0 or 'SPACE'. It is called from the SendMessage
27909  function. sendSpace reads the Xmit00 array and sends the data to the FSK DAC.
27910  The time between the updates is controlled by a timer matching the corresponding
27911  value of the TimeSpace array. An FSK 'zero' is approximately 2800 Hz with
27912  7 cycles lasting approximately 2.5 ms.
27913 
27914  Precondition:
27915  None.
27916  Parameters:
27917  None.
27918  Returns
27919  None.
27920 
27921  Remarks
27922  None.
27923 
27924  Example:
27925  SendSpace()
27926  */
27927 
27928 static void
27929  Send_Space ( void ) ;
27930 /*!*************************************************************************************
27931  Function:
27932  static void Send_Mark( void )
27933  Summary:
27934  This function sends a FSK 1 or 'MARK'.
27935  Description:
27936  This function sends a FSK 1 or 'MARK'. It is called from the Send_Message_Task
27937  function. Send_Mark reads the Xmit11 array and sends the data to the FSK DAC.
27938  The time between the updates is controlled by a timer matching the corresponding
27939  value of the TimeMark array. An FSK 'one' is approximately 5200 Hz with
27940  13 cycles lasting approximately 2.5 ms.
27941 
27942  Precondition:
27943  None.
27944  Parameters:
27945  None.
27946  Returns
27947  None.
27948 
27949  Remarks
27950  None.
27951 
27952  Example:
27953  sendMark()
27954  */
27955 
27956 static void
27957  Send_Mark ( void ) ;
27958 /**************************************************************************************/
27959 /**************************************************************************************/
27960 /* State Machine Functions */
27961 /**************************************************************************************/
27962 /**************************************************************************************/
27963 /*!*************************************************************************************
27964  Function:
27965  void FSK_Tasks(void)
27966  Summary:
27967  FSK_Tasks function
27968  Description:
27969  This routine is the FSK_Tasks function. It defines the FSK_Tasks state
27970  machine and core logic. This machine is used to send an FSK message to a
27971  PerfSwitch. It checks to see if there is a message for Tx and decides if it is a
27972  short or a long message. For a long message, it calculates the CRC and appends
27973  it to the Message and calls Send_Message_Tasks. If a good Manchester response is
27974  received, it resets all flags and prepares to send another message. Otherwise,
27975  it prepares to resend the previous message at a corrected frequency.
27976 
27977  Precondition:
27978  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27979  should be called before calling this.
27980  Parameters:
27981  None.
27982  Returns:
27983  None.
27984  Remarks:
27985  This routine must be called from the APP_Tasks() routine.
27986  Example:
27987  FSK_Tasks()
27988  */
27989 
27990 void
27991  FSK_Tasks ( void ) ;
27992 /*!*************************************************************************************
27993  Function:
27994  static void Send_Message_Tasks(void)
27995  Summary:
27996  Send_Message_Tasks function
27997  Description:
27998  This routine is the Send_Message_Tasks function. It defines the Send_Message_Tasks
27999  state machine and core logic. This machine is used to send an FSK message to a
28000  PerfSwitch. It can control the MAnchester bias DAC. It then controls the PREAMBLE
28001  (PRE_MSG) state machine to send the preamble. Then the actual message is sent.
28002  Precondition:
28003  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28004  should be called before calling this.
28005  Parameters:
28006  None.
28007  Returns:
28008  None.
28009  Remarks:
28010  This routine must be called from the FSK_Tasks() routine.
28011  Example:
28012  Send_Message_Tasks()
28013  */
28014 
28015 static void
28016  Send_Message_Tasks ( void ) ;
28017  /* FSK_H */
28018 /***************************************************************************************
28019  End of File
28020  */
28021 
28022 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h*/
28023 /* CLOSE_FILE Include File */
28024 
28025 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\crc.h */
28026 /**************************************************************************************/
28040 /**************************************************************************************/
28041 #ifndef CRC_H /* Guard against multiple inclusion.*/
28042 #define CRC_H
28043 /**************************************************************************************/
28044 /* ************************************************************************************/
28045 /* Section: Included Files */
28046 /**************************************************************************************/
28047 /**************************************************************************************/
28048 #include <stdint.h>
28049 
28050 typedef
28051 unsigned char
28053 /**************************************************************************************/
28054 /**************************************************************************************/
28055 /* Interface Functions */
28056 /**************************************************************************************/
28057 /**************************************************************************************/
28058 /*!*************************************************************************************
28059  Function:
28060  void Calc_CRC(uint16_t nbits, uint8_t thebits)
28061  Summary:
28062  Function to calculate the CRC for a number of data bits.
28063  Description:
28064  Function to calculate the CRC for a number of data bits. The algorithm for the
28065  CRC calculation was created by Tom Woods. CRCVal is usually reset to 0xFF prior
28066  to calling this function. This is not the case when calculating the CRC for an
28067  array.
28068 
28069  Precondition:
28070  None.
28071  Parameters:
28072  int16_t nbits - the number of data bits.
28073  uint8_t thebits - the data bits themselves.
28074  Returns
28075  None.
28076 
28077  Remarks
28078  None.
28079 
28080  Example:
28081  Calc_CRC( 8, Bytes[ 1 ] )
28082  */
28083 
28084 void
28085  Calc_CRC (
28086  uint16_t nbits ,
28087  uint8_t thebits ) ;
28088 /*!*************************************************************************************
28089  Function:
28090  uint8_t Calc_CRC_Array(uint16_t Count, const uint8_t Bytes[ ] )
28091  Summary:
28092  Function to calculate the CRC of an array of bytes. This function uses the function
28093  CalcCRC to complete this task.
28094  Description:
28095  Function to calculate the CRC of an array of bytes. This function uses the function
28096  CalcCRC to complete this task. It returns the eight bit CRCVal from the
28097  calculation.
28098 
28099  Precondition:
28100  None.
28101  Parameters:
28102  None.
28103  Returns
28104  uint8_t CRCVal
28105 
28106  Remarks
28107  None.
28108 
28109  Example:
28110  a_comm_crc = CalcCRCArray( 6, a_temp )
28111  */
28112 
28113 uint8_t
28114  Calc_CRC_Array (
28115  uint16_t Count ,
28116  const uint8_t Bytes [] ) ;
28117 /*!*************************************************************************************
28118  Function:
28119  uint8_t Calc_CRC_Uplink(int16_t Count, const uint8_t Bytes[ ] )
28120  Summary:
28121  Function to calculate the CRC from a received PerfSwitch message.
28122  Description:
28123  Function to calculate the CRC from a received PerfSwitch message. This function
28124  makes use of the function CalcCRC() to perform the calculation. The CRC result
28125  is compared to the third byte of the returned Manchester message.
28126 
28127 
28128 
28129  Precondition:
28130  None.
28131  Parameters:
28132  int16_t Count: Acts as a flag.
28133  unsigned char Bytes[ ]:
28134  Returns:
28135  uint8_t CRCVal
28136 
28137  Remarks:
28138  None.
28139 
28140  Example:
28141  crcans1 = Calc_CRC_Uplink( 3, MAN.MSG )
28142  */
28143 
28144 uint8_t
28145  Calc_CRC_Uplink (
28146  uint16_t Count ,
28147  const uint8_t Bytes [] ) ;
28148 /*!*************************************************************************************
28149  Function:
28150  void Reset_CRC_Value( void )
28151  Summary:
28152  This function resets the CRC value so a new calculation can take place.
28153  Description:
28154  This function resets the CRC value so a new calculation can take place. It
28155  resets the value to 0xFF. This allows for the proper bit manipulation during
28156  the CRC calculation.
28157 
28158  Precondition:
28159  None.
28160  Parameters:
28161  None.
28162  Returns
28163  None.
28164 
28165  Remarks
28166  None.
28167 
28168  Example:
28169  Reset_CRC_Value()
28170  */
28171 
28172 void
28173  Reset_CRC_Value ( void ) ;
28174 /*!*************************************************************************************
28175  Function:
28176  uint8_t GetCRCValue( void ))
28177  Summary:
28178  Function to return a previously calculated CRC value.
28179  Description:
28180  Function to return a previously calculated CRC value. No calculations are done
28181  here.
28182 
28183  Precondition:
28184  None.
28185  Parameters:
28186  None.
28187  Returns
28188  uint8_t CRCVal
28189 
28190  Remarks
28191  None.
28192 
28193  Example:
28194  FSK.crc = Get_CRC_Value( )
28195  */
28196 
28197 uint8_t
28198  Get_CRC_Value ( void ) ;
28199  /* CRC_H */
28200 /***************************************************************************************
28201  End of File
28202  */
28203 
28204 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\crc.h*/
28205 /* CLOSE_FILE Include File */
28206 
28207 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h */
28208 /**************************************************************************************/
28222 /**************************************************************************************/
28223 #ifndef MAN_H /* Guard against multiple inclusion.*/
28224 #define MAN_H
28225 /**************************************************************************************/
28226 /**************************************************************************************/
28227 /* Section: Included Files */
28228 /**************************************************************************************/
28229 /**************************************************************************************/
28230 #include <stdbool.h>
28231 #include "../system_config.h"
28232 #include "../system_definitions.h"
28233 /**************************************************************************************/
28234 /**************************************************************************************/
28235 /* Section: Defines */
28236 /**************************************************************************************/
28237 /**************************************************************************************/
28238 /* Define the upper and lower bounds for Manchester data, TMR4 tick = 200nsec * 8 = 1.6usec */
28239 /* Define the upper and lower bounds for Manchester data, TMR2 tick = 10nS * 16 = 160nS. */
28240 //#define ManHalfUpper 1171 /* 1.8736 mS.*/
28241 //#define ManHalfLower 500 /* 0.8 mS.*/
28242 //#define ManFullUpper 1953 /* 3.12148 mS.*/
28243 //#define ManFullLower 1172 /* 1.8752 mS.*/
28244 //#define ManHalfUpper 6400 /* 1.8736 mS.?*/ /* time div = 32*/
28245 //#define ManHalfLower 1000 /* 0.8 mS.?*/
28246 //#define ManFullUpper 10000 /* 3.12148 mS.?*/
28247 //#define ManFullLower 6401 /* 1.8752 mS.?*/
28248 #define ManHalfUpper 11800U
28249 #define ManHalfLower 2000U
28250 #define ManFullUpper 20000U
28251 #define ManFullLower 11801U
28252 #define NoManBits 32U
28253 #define HalfBit 0x12U
28254 #define FullBit 0x10U
28255 #define SizeOfBiasLUT 48U
28256 /**************************************************************************************/
28257 /**************************************************************************************/
28258 /* Section: Data Types */
28259 /**************************************************************************************/
28260 /**************************************************************************************/
28261 
28262 typedef
28263 float
28264  float32_t ;
28265 /**************************************************************************************/
28266 /* MAN states
28267  Summary:
28268  MAN states enumeration
28269  Description:
28270  This enumeration defines the valid MAN states. These states determine the
28271  behavior of the MAN state machine at various times. This machine controls when
28272  the MAN_RX and MAN_PROCESS machines execute their states.
28273 */
28274 
28275 typedef
28276  enum
28277  {
28284  } MAN_STATES ;
28285 /**************************************************************************************/
28286 /* MAN_RX_STATES
28287  Summary:
28288  MAN_RX_STATES enumeration
28289  Description:
28290  This enumeration defines the valid MAN_RX_STATES. These states determine the
28291  behavior of the MAN_RX_STATES machine at various times. This machine receives
28292  the data from a PerfSwtich.
28293 */
28294 
28295 typedef
28296  enum
28297  {
28301  } MAN_RX_STATES ;
28302 /**************************************************************************************/
28303 /* MAN_PROCESS_STATES
28304  Summary:
28305  MAN_PROCESS_STATES enumeration
28306  Description:
28307  This enumeration defines the valid MAN_PROCESS_STATES. These states
28308  determine the behavior of the MAN_PROCESS_STATES machine at various times.
28309 */
28310 
28311 typedef
28312  enum
28313  {
28317  } MAN_PROCESS_STATES ;
28318 /**************************************************************************************/
28319 /* MAN_DATA
28320  Summary:
28321  Holds MAN_DATA used for the Manchester tasks.
28322  Description:
28323  Holds MAN_DATA used for the Manchester tasks. The state machines and variables
28324  used to control Manchester functions are stored here.
28325  Remarks:
28326  None
28327  */
28328 
28329 typedef
28330  struct
28331  {
28332  MAN_STATES state ;
28333  MAN_RX_STATES Rx_state ;
28334  MAN_PROCESS_STATES Process_state ;
28335  uint16_t preamble [ 5 ] ;
28336  uint16_t time [ 96 ] ;
28337  uint8_t level [ 96 ] ;
28338  uint8_t ans [ 32U + 2 ] ;
28339  uint8_t msg [ 4 ] ;
28340  uint8_t cnt_preamble ;
28341  uint8_t trynumber ;
28342  bool process_complete_flag ;
28343  bool spi_write_complete_flag ;
28344  bool spi_sent_flag ;
28345  uint8_t timer_count ;
28346  uint8_t timer_complete ;
28347  bool tick ;
28348  bool bad_crc ;
28349  bool error ;
28350  bool manual_bias_flag ;
28351  uint8_t crc ;
28352  } MAN_DATA ;
28353 
28354 extern MAN_DATA
28355  MAN ;
28356 /**************************************************************************************/
28357 /* MAN_BIAS_DATA
28358  Summary:
28359  Holds MAN_BIAS_DATA
28360  Description:
28361  This structure holds the MAN_BIAS_DATA. It is used to adjust the bias value of
28362  the Manchester DAC.
28363  Remarks:
28364  None
28365  */
28366 
28367 typedef
28368  struct
28369  {
28370  DRV_HANDLE spi_bias_fsk ;
28371  DRV_SPI_BUFFER_HANDLE bufferHandle ;
28372  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
28373  uint16_t adj [ 1 ] ;
28374  uint16_t dac_a_setting ;
28375  uint16_t dac_b_setting ;
28376  float32_t hi_current ;
28377  float32_t lo_current ;
28378  float32_t lo_volts ;
28379  float32_t hi_volts ;
28380  float32_t slope ;
28381  float32_t offset ;
28382  uint8_t index ;
28383  } MAN_BIAS_DATA ;
28384 
28385 extern MAN_BIAS_DATA
28386  MAN_BIAS ;
28387 /**************************************************************************************/
28388 /**************************************************************************************/
28389 /* Local Functions */
28390 /**************************************************************************************/
28391 /**************************************************************************************/
28392 /*!*************************************************************************************
28393  Function:
28394  static void Init_Manchester( void )
28395  Summary:
28396  Function to initialize the Manchester parameters.
28397  Description:
28398  Function to initialize the Manchester parameters.
28399 
28400  Precondition:
28401  None.
28402  Parameters:
28403  None.
28404  Returns:
28405  None.
28406 
28407  Remarks:
28408  None.
28409 
28410  Example:
28411  Init_Manchester()
28412  */
28413 
28414 static void
28415  Init_Manchester ( void ) ;
28416 /*!*************************************************************************************
28417  Function:
28418  static bool Check_Manchester( void )
28419  Summary:
28420  This routine checks for valid Manchester response.
28421  Description:
28422  This routine checks for valid Manchester response. The first two bytes are
28423  checked. If both are zero, then we did not receive a valid response. This is
28424  used in the function Test_Manchester.
28425 
28426  Precondition:
28427  None.
28428  Parameters:
28429  None.
28430  Returns:
28431  bool ans
28432 
28433  Remarks:
28434  None.
28435 
28436  Example:
28437  if( Check_Manchester( ) == true )
28438  */
28439 
28440 static bool
28441  Check_Manchester ( void ) ;
28442 /*!*************************************************************************************
28443  Function:
28444  static void Decode_Manchester( void )
28445  Summary:
28446  Function to decode the Manchester response from a PerfSwitch.
28447  Description:
28448  Function to decode the Manchester response from a PerfSwitch. The MAN.level
28449  and MAN.time arrays are used to generate the MAN.ANS array.
28450  MAN.level[] - level of the incoming data.
28451  MAN.time[] - time of corresponding wave timer ticks.
28452 
28453  The last 1 of the preamble is always in the data so we have a fixed starting point.
28454 
28455  Precondition:
28456  None.
28457  Parameters:
28458  None.
28459  Returns:
28460  None.
28461 
28462  Remarks:
28463  None.
28464 
28465  Example:
28466  Decode_Manchester()
28467  */
28468 
28469 static void
28470  Decode_Manchester ( void ) ;
28471 /*!*************************************************************************************
28472  Function:
28473  static void Package_Manchester( void )
28474  Summary:
28475  Function to prepare Manchester response for further processing.
28476  Description:
28477  Function to prepare Manchester response for further processing. The Manchester
28478  response is decoded and the 1 X 32 answer array is packed into a 4 X 8 bit
28479  message array.
28480 
28481  Precondition:
28482  None.
28483  Parameters:
28484  None.
28485  Returns:
28486  None.
28487 
28488  Remarks:
28489  None.
28490 
28491  Example:
28492  Package_Manchester()
28493  */
28494 
28495 static void
28496  Package_Manchester ( void ) ;
28497 /*!*************************************************************************************
28498  Function:
28499  static void Test_Manchester (void)
28500  Summary:
28501  Function to test the returned Manchester message.
28502  Description:
28503  Function to test the returned Manchester message. The first two bytes are checked
28504  to make sure they are not both 0. If they are not, the FSK frequencies are
28505  adjusted, and the CRC is checked. If the CRC is a match, then a response message
28506  to the host is prepared. Otherwise, up to two different FSK frequencies are
28507  tried in order to establish communications with a PerfSwitch.
28508 
28509  Precondition:
28510  None.
28511  Parameters:
28512  None.
28513  Returns:
28514  None.
28515 
28516  Remarks:
28517  None.
28518 
28519  Example:
28520  Test_Manchester ()
28521  */
28522 
28523 static void
28524  Test_Manchester ( void ) ;
28525 /*!*************************************************************************************
28526  Function:
28527  static void Flush_Buffer_Manchester( void )
28528  Summary:
28529  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
28530  Description:
28531  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
28532  These are flushed after every reception.
28533 
28534  Precondition:
28535  None.
28536  Parameters:
28537  None.
28538  Returns:
28539  None.
28540 
28541  Remarks:
28542  None.
28543 
28544  Example:
28545  Flush_Buffer_Manchester()
28546  */
28547 
28548 static void
28549  Flush_Buffer_Manchester ( void ) ;
28550 /*!*************************************************************************************
28551  Function:
28552  static float32_t Calc_Fsk_Scaling( void )
28553  Summary:
28554  Function to calculate the amount of FSK adjustment needed based on the preamble bit
28555  timer counts.
28556  Description:
28557  Function to calculate the amount of FSK adjustment needed based on the preamble bit
28558  timer counts. The average of the timer counts is used to determine the amount
28559  of adjustment. The result is a multiplier used in the Generate_Sine_Wave _Data
28560  function to change the amount of time between the FSK DAC updates. Adjustments
28561  up to 10% have been seen in temperature testing. Adjustments are generally
28562  greater than 1 when a PerfSwitch is hot and less than 1 when a PerfSwitch is cold.
28563 
28564  Precondition:
28565  None.
28566  Parameters:
28567  None.
28568  Returns:
28569  None.
28570 
28571  Remarks:
28572  None.
28573 
28574  Example:
28575  CalcFskScaling( )
28576  */
28577 
28578 static float32_t
28579  Calc_Fsk_Scaling ( void ) ;
28580 /**************************************************************************************/
28581 /**************************************************************************************/
28582 /* Interface Functions */
28583 /**************************************************************************************/
28584 /**************************************************************************************/
28585 /*!*************************************************************************************
28586  Function:
28587  void Calc_Auto_Bias(void)
28588  Summary:
28589  Function to calculate the amount of bias adjust required and to transmit that
28590  result via a SPI port to the Manchester bias DAC.
28591  Description:
28592  Function to calculate the amount of bias adjust required and to transmit that
28593  result via a SPI port to the Manchester bias DAC.
28594 
28595  Precondition:
28596  None.
28597  Parameters:
28598  None.
28599  Returns:
28600  None.
28601 
28602  Remarks:
28603  None.
28604 
28605  Example:
28606  CalcAutoBias()
28607  */
28608 
28609 void
28610  Calc_Auto_Bias ( void ) ;
28611 /*!*************************************************************************************
28612  Function:
28613  void Set_Bias(uint8_t value)
28614  Summary:
28615  Function to transmit the bias adjust value via an SPI port to the Manchester
28616  bias DAC.
28617  Description:
28618  Function to transmit the bias adjust value via an SPI port to the Manchester
28619  bias DAC. Value is integer between 0 and 47. Values greater than 47 are set to 47.
28620 
28621  Precondition:
28622  None.
28623  Parameters:
28624  uint8_t value
28625  Returns:
28626  None.
28627 
28628  Remarks:
28629  None.
28630 
28631  Example:
28632  Set_Bias(uint8_t value)
28633  */
28634 
28635 void
28636  Set_Bias (
28637  uint8_t value ) ;
28638 /**************************************************************************************/
28639 /**************************************************************************************/
28640 /* State Machine Functions */
28641 /**************************************************************************************/
28642 /**************************************************************************************/
28643 /*!*************************************************************************************
28644  Function:
28645  void MAN_Tasks(void)
28646  Summary:
28647  MAN tasks function
28648  Description:
28649  This routine is the MAN tasks function. It defines the MAN's state machine and
28650  core logic. This machine controls the MAN operation and sets flags indicating
28651  new values are available from the system interrupt routine for use in other parts
28652  of the application. It also controls when the MAN_Process_Tasks machine and
28653  MAN_RX_Tasks machines operate.
28654  Precondition:
28655  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28656  should be called before calling this.
28657  Parameters:
28658  None.
28659  Returns:
28660  None.
28661  Example:
28662  MAN_Tasks()
28663 
28664  Remarks:
28665  This routine must be called from the APP_Tasks() routine.
28666  */
28667 
28668 void
28669  MAN_Tasks ( void ) ;
28670 /*!*************************************************************************************
28671  Function:
28672  static void MAN_PROCESS_Tasks(void)
28673  Summary:
28674  MAN_PROCESS tasks function
28675  Description:
28676  This routine is the MAN_PROCESS tasks function. It defines the MAN_PROCESS's
28677  state machine and core logic. This machine controls the MAN_Process operation. It
28678  decodes, packages, tests and prepares for another message to process.
28679 
28680  During packaging, the 32 bit Manchester response is packaged into a 4 byte array.
28681 
28682  During testing, the CRC is checked and the appropriate response is prepared to
28683  send to the host. If a bad response was received, the FSK frequencies are adjusted
28684  and two more attempts are made to retrieve a valid response.
28685 
28686  Precondition:
28687  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28688  should be called before calling this.
28689  Parameters:
28690  None.
28691  Returns:
28692  None.
28693  Example:
28694  MAN_PROCESS_Tasks()
28695 
28696  Remarks:
28697  This routine must be called from the MAN_Tasks() routine.
28698  */
28699 
28700 static void
28701  MAN_PROCESS_Tasks ( void ) ;
28702 /*!*************************************************************************************
28703  Function:
28704  void MAN_RX_Tasks(void)
28705  Summary:
28706  MAN_Rx tasks function
28707  Description:
28708  This routine is the MAN_Rx tasks function. It defines the MAN_Rx's
28709  state machine and core logic. It determines if a proper message preamble has
28710  been received and determines the time and input level state when a transition
28711  occurs. This routine is called when there is a high to low change on the port pin.
28712 
28713  The state MAN_RX_STATE_IDLE has no effect on Manchester processing.
28714  The state MAN_RX_STATE_PREAMBLE is responsible for syncing up to a 1111.
28715  The state MAN_RX_STATE_DATA receives the data. The time ranges allow for variances
28716  between PerfSwitches and how they perform over temperature.
28717 
28718  Precondition:
28719  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28720  should be called before calling this.
28721  Parameters:
28722  None.
28723  Returns:
28724  None.
28725  Example:
28726  MAN_RX_Tasks()
28727 
28728  Remarks:
28729  This routine must be called from the MAN_Tasks() routine.
28730  */
28731 
28732 void
28733  MAN_RX_Tasks ( void ) ;
28734  /* MAN_H */
28735 /***************************************************************************************
28736  End of File
28737  */
28738 
28739 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h*/
28740 /* CLOSE_FILE Include File */
28741 
28742 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h */
28743 /**************************************************************************************/
28758 /**************************************************************************************/
28759 #ifndef WL_CPS_H /* Guard against multiple inclusion */
28760 #define WL_CPS_H
28761 /**************************************************************************************/
28762 /* ************************************************************************************/
28763 /* Section: Included Files */
28764 /**************************************************************************************/
28765 /**************************************************************************************/
28766 #include "../system_definitions.h"
28767 
28768 typedef
28769 float
28770  float32_t ;
28771 /**************************************************************************************/
28772 /**************************************************************************************/
28773 /* Section: Data Types */
28774 /**************************************************************************************/
28775 /**************************************************************************************/
28776 
28777 typedef
28778  enum
28779  {
28786  } WL_CPS_STATES ;
28787 
28788 typedef
28789  struct
28790  {
28791  WL_CPS_STATES state ;
28792  DRV_HANDLE spi_cont_pot ;
28793  DRV_SPI_BUFFER_HANDLE bufferHandle ;
28794  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
28795  int8_t v_adj [ 1 ] ;
28796  uint16_t voltage ;
28797  uint16_t voltage_limit ;
28798  uint16_t current ;
28799  uint16_t max_current ;
28800  uint8_t current_limit ;
28801  uint8_t upper_current_limit ;
28802  uint8_t over_current_count ;
28803  float32_t volt_constant ;
28804  float32_t current_constant ;
28805  bool new_voltage_flag ;
28806  bool new_current_flag ;
28807  bool spi_write_complete_flag ;
28808  bool spi_sent_flag ;
28809  uint8_t avg_count ;
28810  uint8_t avg_count_max ;
28811  uint16_t current_array [ 5 ] ;
28812  uint16_t avg_current ;
28813  uint8_t overvoltage_count ;
28814  } WL_CPS_DATA ;
28815 
28816 extern WL_CPS_DATA
28817  WL_CPS ;
28818 /**************************************************************************************/
28819 /**************************************************************************************/
28820 /* Section: Local Functions */
28821 /**************************************************************************************/
28822 /**************************************************************************************/
28823 /*!*************************************************************************************
28824  Function:
28825  static void Init_WL_CPS( void )
28826  Summary:
28827  This function initializes the wire-line communication power supply parameters.
28828  Description:
28829  This function initializes the wire-line communication power supply parameters.
28830  Initial limits, flags and constants are set here.
28831 
28832  Precondition:
28833  None.
28834  Parameters:
28835  None.
28836  Returns
28837  None.
28838 
28839  Remarks
28840  None.
28841 
28842  Example:
28843  Init_WL_CPS()
28844  */
28845 
28846 static void
28847  Init_WL_CPS ( void ) ;
28848 /*!*************************************************************************************
28849  Function:
28850  static void Read_WL_CPS_V_I( void )
28851  Summary:
28852  This task reads the voltage and current from the wire line communication power
28853  supply(WL_CPS). It also tracks the maximum current from the supply.
28854  Description:
28855  This task reads the voltage and current from the wire line communication power
28856  supply(WL_CPS). It also tracks the maximum current from the supply.
28857 
28858  Precondition:
28859  None.
28860  Parameters:
28861  None.
28862  Returns
28863  None.
28864 
28865  Remarks
28866  None.
28867 
28868  Example:
28869  Read_WL_CPS_V_I( )
28870  */
28871 
28872 static void
28873  Read_WL_CPS_V_I ( void ) ;
28874 /*!*************************************************************************************
28875  Function:
28876  static void Check_WL_CPS_Over_Current( void )
28877  Summary:
28878  This function checks if the WL_CPS current has exceeded the current limit.
28879  Description:
28880  This function checks if the WL_CPS current has exceeded the current limit. If
28881  the current has exceeded the limit for five readings, the supply is turned off.
28882 
28883  Precondition:
28884  None.
28885  Parameters:
28886  None.
28887  Returns
28888  None.
28889 
28890  Remarks
28891  None.
28892 
28893  Example:
28894  Check_WL_CPS_Over_Current( )
28895  */
28896 
28897 static void
28898  Check_WL_CPS_Over_Current ( void ) ;
28899 /*!*************************************************************************************
28900  Function:
28901  void Set_WL_CPS_CurrentLimit(uint8_t value)
28902  Summary:
28903  This function sets the WL_CPS current limit.
28904  Description:
28905  This function sets the WL_CPS current limit. It must be less than or equal to
28906  the upper current limit. This parameter is used in the over current check.
28907 
28908  Precondition:
28909  None.
28910  Parameters:
28911  uint8_t value - the current limit in mA.
28912  Returns
28913  None.
28914 
28915  Remarks
28916  None.
28917 
28918  Example:
28919  Set_WL_CPS_CurrentLimit(70)
28920  */
28921 
28922 void
28924  uint8_t value ) ;
28925 /*!*************************************************************************************
28926  Function:
28927  void Adjust_WL_CPS_Voltage(uint8_t target)
28928  Summary:
28929  This function adjusts the WL_CPS to the desired voltage.
28930  Description:
28931  This function adjusts the WL_CPS to the desired voltage. The value is checked
28932  to ensure it is within the adjustable limits of 15 to 64 VDC. That voltage is
28933  converted to a table value that contains the appropriate pot settings for a
28934  given voltage. The pot settings is then transmitted via SPI port to the
28935  WL_CPS control pot.
28936 
28937  Precondition:
28938  None.
28939  Parameters:
28940  uint8_t target - desired voltage between 15 and 64V.
28941  Returns
28942  None.
28943 
28944  Remarks
28945  None.
28946 
28947  Example:
28948  Adjust_WL_CPS_Voltage(30)
28949  */
28950 
28951 void
28953  uint8_t target ) ;
28954 /**************************************************************************************/
28955 /**************************************************************************************/
28956 /* State Machine Functions */
28957 /**************************************************************************************/
28958 /**************************************************************************************/
28959 /*!*************************************************************************************
28960  Function:
28961  *
28962  void WL_CPS_Tasks(void)
28963  Summary:
28964  WL_CPS_Tasks function
28965  Description:
28966  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
28967  machine and core logic. This machine is used to monitor the wire-line communication
28968  power supply (WL_CPS) voltage and current and will set flags when those limits
28969  are exceeded.
28970  Precondition:
28971  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28972  should be called before calling this.
28973  Parameters:
28974  None.
28975  Returns:
28976  None.
28977  Remarks:
28978  This routine must be called from the APP_Tasks() routine.
28979  Example:
28980  WL_CPS_Tasks()
28981  */
28982 
28983 void
28984  WL_CPS_Tasks ( void ) ;
28985  /* WL_CPS_H */
28986 /***************************************************************************************
28987  End of File
28988  */
28989 
28990 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h*/
28991 /* CLOSE_FILE Include File */
28992 
28993 #include "../system_config.h"
28994 #include "../system_definitions.h"
28995 #include <stdint.h>
28996 #include <stddef.h>
28997 #include <math.h>
28998 #include <xc.h>
28999 /**************************************************************************************/
29000 /**************************************************************************************/
29001 /* Section: Defines */
29002 /**************************************************************************************/
29003 /**************************************************************************************/
29004 #define testbit( var , bit ) ( ( ( var ) & ( 1U << ( bit ) ) ) != 0U )
29005 /**************************************************************************************/
29006 /**************************************************************************************/
29007 /* Section: Structure Data */
29008 /**************************************************************************************/
29009 /**************************************************************************************/
29010 /**************************************************************************************/
29011 /* FSK Data
29012  Summary:
29013  These structures hold the required states and variables to perform the FSK tasks.
29014  Description:
29015  These structures hold the required states and variables to perform the FSK tasks.
29016  These are here to link these structures for use by the local functions.
29017  *
29018  Remarks:
29019  These are defined in fsk.h
29020 */
29021 
29022 DOWN_MSG
29024 
29027 
29028 FSK_DATA
29030 
29031 MSG_DATA
29033 
29034 PRE_DATA
29036 /**************************************************************************************/
29037 /**************************************************************************************/
29038 /* Section: Local Variables */
29039 /**************************************************************************************/
29040 /**************************************************************************************/
29041 
29042 static uint8_t
29043  TimeMark [ 312 ] ;
29044 
29045 static uint8_t
29046  TimeSpace [ 168 ] ;
29047 
29048 static volatile float32_t
29050  errorSpace ;
29051 /**************************************************************************************/
29052 /**************************************************************************************/
29053 /* Section: State Machine Functions */
29054 /**************************************************************************************/
29055 /**************************************************************************************/
29056 /***************************************************************************************
29057  Function:
29058  void FSK_Tasks( ( void )
29059  Summary:
29060  This routine is the FSK tasks function. It defines the (FSK) state machine and
29061  core logic.
29062  Remarks:
29063  Refer to the fsk.h interface header for function usage details.
29064  */
29065 
29066 void
29067  FSK_Tasks ( void )
29068  {
29069  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
29070  switch (
29071  ( ( int )( /* 29 */
29072  FSK.state
29073  ))*
29074  ((bitmapstruct.element1 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ) /* 19 */
29075  )
29076  {
29077  case FSK_STATE_INIT :
29078  ((bitmapstruct.element1 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
29079  {
29080  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 23 */
29081 
29082  Init_FSK () ; /* Initialize the FSK parameters and start Timer 2.*/
29083  FSK.state = FSK_STATE_CHECK_MESSAGE_READY ; /* Move on to see if a message to a PerfSwitch is ready to be sent.*/
29084  PRE_MSG.state = PREAMBLE_STATE_IDLE ; /* Put the FSK preamble state machine in idle.*/
29085  MSG.state = MSG_STATE_IDLE ; /* Put the Send_Message_task state machine in idle.*/
29086  }
29087  ((int)(bitmapstruct.element2 |= (1 << 0))); /* 16 */
29088  goto l128922 ;
29090  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
29091  {
29092  if
29093  (
29094  DWNMSG.xmit_ready_flag != 0x00U
29095  ) /* If we are ready to transmit a message to a PerfSwitch.*/
29096  {
29097  ((int)(bitmapstruct.element2 |= (1 << 2))); /* 1 */
29098  { /* This flag is set in the Protocol B commands.*/
29099  FSK.state = FSK_STATE_PREP_MESSAGE ; /* Move on to prep the message.*/
29100  }
29101  } else ((int)(bitmapstruct.element2 |= (1 << 3))); /* 4 */
29102  }
29103  ((int)(bitmapstruct.element2 |= (1 << 4))); /* 16 */
29104  goto l128922 ;
29105  case FSK_STATE_PREP_MESSAGE :
29106  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 5) : 0)), 1 ); /* 41 */
29107  {
29108  switch (
29109  ( ( int )( /* 29 */
29111  ))*
29112  ((bitmapstruct.element2 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ) /* 19 */
29113  ) /* Determine the message length.*/
29114  {
29115  case 0x04U :
29116  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 7) : 0)), 1 ); /* 41 */
29117  {
29118  MSG.command = DWNMSG.identifier ; /* Configure the message command.*/
29119  MSG.length = DWNMSG.msg_length - 1U ; /* Configure the message length.*/
29120  FSK.state = FSK_STATE_SEND_MESSAGE ; /* Move on to send the message.*/
29121  MSG.state = MSG_STATE_CAL_MAN_BIAS_1 ; /* Initialize the first task in the SEND_MESSAGE_Tasks machine.*/
29122  }
29123  ((int)(bitmapstruct.element2 |= (1 << 8))); /* 16 */
29124  goto l128875 ;
29125  case 0x14U :
29126  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 9) : 0)), 1 ); /* 41 */
29127  {
29128  Reset_CRC_Value () ; /* Reset the CRC value.*/
29129  Calc_CRC ( 3 , DWNMSG.identifier ) ; /* CRC is not calculated for the Long/Short Bit */
29130  Calc_CRC ( 8 , DWNMSG.command ) ; /* Update the CRC result with the command byte.*/
29131  FSK.crc = Get_CRC_Value () ;
29132  MESSAGE.byte[ 2 ] = DWNMSG.identifier ; /* Prepare the message.*/
29133  MESSAGE.byte[ 1 ] = DWNMSG.command ;
29134  MESSAGE.byte[ 0 ] = FSK.crc ;
29135  MSG.command = MESSAGE.dword ; /* Configure the message command.*/
29136  MSG.length = DWNMSG.msg_length - 1U ; /* Configure the message length.*/
29137  FSK.state = FSK_STATE_SEND_MESSAGE ; /* Move on to send the message.*/
29138  MSG.state = MSG_STATE_CAL_MAN_BIAS_1 ; /* Initialize the first task in the SEND_MESSAGE_Tasks machine.*/
29139  }
29140  ((int)(bitmapstruct.element2 |= (1 << 10))); /* 16 */
29141  goto l128875 ;
29142  default :
29143  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 11) : 0)), 1 ); /* 41 */
29144  {
29145  /*Comment.*/
29146  }
29147  ((int)(bitmapstruct.element2 |= (1 << 12))); /* 16 */
29148  goto l128875 ;
29149  }
29150 l128875 :
29151  ; /* 18 */
29152  }
29153  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 16 */
29154  goto l128922 ;
29155  case FSK_STATE_SEND_MESSAGE :
29156  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 14) : 0)), 1 ); /* 41 */
29157  {
29158  ((int)(bitmapstruct.element2 |= (1 << 15))); /* 23 */
29159 
29160  Send_Message_Tasks () ; /* Send the FSK message to the PerfSwitch.*/
29161  if
29162  (
29164  ) /* If we have completed sending the message,*/
29165  {
29166  ((int)(bitmapstruct.element2 |= (1 << 16))); /* 1 */
29167  {
29168  FSK.state = FSK_STATE_WAIT ; /* Move on to wait for the Manchester response.*/
29169  MAN.state = MAN_STATE_RECEIVE_START ; /* Initiate the Manchester Receive tasks.*/
29170  }
29171  } else ((int)(bitmapstruct.element2 |= (1 << 17))); /* 4 */
29172  }
29173  ((int)(bitmapstruct.element2 |= (1 << 18))); /* 16 */
29174  goto l128922 ;
29175  case FSK_STATE_WAIT :
29176  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 19) : 0)), 1 ); /* 41 */
29177  /* Wait here for the Manchester response.*/
29178  {
29179  }
29180  ((int)(bitmapstruct.element2 |= (1 << 20))); /* 16 */
29181  goto l128922 ;
29183  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 21) : 0)), 1 ); /* 41 */
29184  /* Machines moves here after Manchester response is received.*/
29185  {
29186  if
29187  (
29188  MAN.trynumber <= 0x02U
29189  ) /* If we do not have to retry to send an FSK message,*/
29190  {
29191  ((int)(bitmapstruct.element2 |= (1 << 22))); /* 1 */
29192  {
29193  DWNMSG.xmit_ready_flag = 0x00U ; /* Reset the transmit ready flag.*/
29194  MESSAGE.dword = 0U ; /* Reset the message.*/
29195  FSK.state = FSK_STATE_CHECK_MESSAGE_READY ; /* Move on to see if another message needs to be transmitted.*/
29197  }
29198  ((int)(bitmapstruct.element2 |= (1 << 23))); /* 3 */
29199  }
29200  else /* Otherwise,*/
29201  {
29202  ((int)(bitmapstruct.element2 |= (1 << 24))); /* 2 */
29203  {
29204  FSK.state = FSK_STATE_CHECK_MESSAGE_READY ; /* Move on to retransmit the message.*/
29206  }
29207  }
29208  }
29209  ((int)(bitmapstruct.element2 |= (1 << 25))); /* 16 */
29210  goto l128922 ;
29211  default :
29212  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 26) : 0)), 1 ); /* 41 */
29213  {
29214  /*Comment.*/
29215  }
29216  ((int)(bitmapstruct.element2 |= (1 << 27))); /* 16 */
29217  goto l128922 ;
29218  }
29219 l128922 :
29220  ; /* 18 */
29221  ((int)(bitmapstruct.element2 |= (1 << 28))); /* 30 */
29222  fsk_60zqendz ( 93 ) ; /* 30 */
29223  }
29224 /**************************************************************************************/
29225 /**************************************************************************************/
29226 /* Section: Interface Functions */
29227 /**************************************************************************************/
29228 /**************************************************************************************/
29229 /*!*************************************************************************************
29230  Function:
29231  void Prepare_Dwn_Msg( uint8_t Identifier, uint8_t Command, uint8_t msgLength )
29232  Summary:
29233  Receives information from the command parser and stores it into the structure
29234  for FSK.
29235  Remarks:
29236  Refer to the fsk.h interface header for function usage details.
29237  */
29238 
29239 void
29241  uint8_t Identifier ,
29242  uint8_t Cmd ,
29243  uint8_t Msg_Length )
29244  {
29245  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 29))); /* 37 */
29246  DWNMSG.identifier = Identifier ; /* The state ID to be transmitted.*/
29247  DWNMSG.command = Cmd ; /* The command to be transmitted.*/
29248  DWNMSG.msg_length = Msg_Length ; /* The length of the message in bits.*/
29249  ((int)(bitmapstruct.element2 |= (1 << 30))); /* 30 */
29250  fsk_60zqendz ( 95 ) ; /* 30 */
29251  }
29252 /**************************************************************************************/
29253 /**************************************************************************************/
29254 /* Section: Local Functions */
29255 /**************************************************************************************/
29256 /**************************************************************************************/
29257 /*!*************************************************************************************
29258  Function:
29259  static void Init_FSK( void )
29260  Summary:
29261  Function to initialize FSK parameters.
29262  Remarks:
29263  Refer to the fsk.h interface header for function usage details.
29264  */
29265 
29266 static void
29267  Init_FSK ( void )
29268  {
29269  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 31))); /* 37 */
29270  FSK.mark_count = 47.0F ;/* Single 3.0. Box. The initial number of time counts between DAC updates.*/
29271  FSK.space_count = 87.0F ;/* Single 1.8. Single 3.0. Box. The initial number of time counts between DAC updates.*/
29272  MESSAGE.dword = 0U ;/* Initialize the FSK message to send to 0.*/
29273  DWNMSG.xmit_ready_flag = 0x00U ;/* Reset flag to indicate that we are not ready to send a message.*/
29274  FSK.send_message_complete_flag = false ;/* Flag to show we have completed sending an FSK message.*/
29275  FSK.null_count = 0U ;/* Initialize null count to 0. Used to determine 2.5mS null time in preamble.*/
29276  FSK.tick = false ;/* Initialize the FSK timer tick.*/
29277  FSK.baud = 405.0F ;/* Initial FSK baud rate in Hertz. Based on temperature testing.*/
29278  FSK.fsk_timer_freq = 6250000.0F ;/* 10nS clock w/ 16 pre-scalar gives 160nS period.*/
29279  ((int)(bitmapstruct.element3 |= (1 << 0))); /* 23 */
29280 
29282  1.0 ) ; /* Generate the table with no correction.*/
29283  ( void ) DRV_TMR2_Start () ;/* Start the timer 2 instance using (Timer 6). Set for 160nS.*/
29284  ((int)(bitmapstruct.element3 |= (1 << 1))); /* 30 */
29285  fsk_60zqendz ( 98 ) ; /* 30 */
29286  }
29287 /***************************************************************************************
29288  Routine Name: Send_Message_Tasks
29289  Date Created: September 3, 2009
29290  Author: F.N.Pundole
29291  Description: This task receives the message and type
29292  (Long or Short i.e. message length directly)of message to be
29293  transmitted. Sends a Tickle, 1,1,0 and the command
29294  Input : Identifier & Command as long, msgLength
29295  Output: None.
29296 ***************************************************************************************/
29297 
29298 static void
29300  {
29301  int izzqqzz=((int)(bitmapstruct.element3 |= (1 << 2))); /* 37 */
29302  switch (
29303  ( ( int )( /* 29 */
29304  MSG.state
29305  ))*
29306  ((bitmapstruct.element3 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 3) : 0)), 1 ) /* 19 */
29307  )
29308  {
29309  case MSG_STATE_IDLE :
29310  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ); /* 41 */
29311  /* The initial state to wait for a FSK message to send.*/
29312  {
29313  /* No action occurs here.*/
29314  }
29315  ((int)(bitmapstruct.element3 |= (1 << 5))); /* 16 */
29316  goto l129184 ;
29318  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
29319  /* Perform the first Manchester bias adjustment.*/
29320  { /* Accessed from the FSK state machine.*/
29321  if
29322  (
29323  MAN.manual_bias_flag == false
29324  ) /* If we have not set the MAN bias manually,*/
29325  {
29326  ((int)(bitmapstruct.element3 |= (1 << 7))); /* 1 */
29327  {
29328  if
29329  ( /* 50 */
29330  (
29331 
29332  ( /* 52 */
29333  (
29334  MAN.spi_sent_flag == false
29335  )
29336  ? (bitmapstruct.element3 |= (1 << 8 ), 1)
29337  : (bitmapstruct.element3 |= (1 << 9 ), 0) ) /* 54 */
29338  &&
29339  ( MAN_BIAS.spi_bias_fsk != (
29340  (
29341  ( DRV_HANDLE ) - 1 ) ) )
29342  )
29343  ) /* 1 */
29344  {
29345  ((int)(bitmapstruct.element3 |= (1 << 10))); /* 1 */
29346  {
29347  Calc_Auto_Bias () ; /* Calculate the correct bias and send data to the MAN_BIAS SPI port.*/
29348  MAN.spi_sent_flag = true ; /* Set this flag to show we sent data to the MAN_BIAS SPI port.*/
29349  }
29350  } else ((int)(bitmapstruct.element3 |= (1 << 11))); /* 4 */
29351  if
29352  (
29354  ) /* If the SPI port is through sending data,*/
29355  {
29356  ((int)(bitmapstruct.element3 |= (1 << 12))); /* 1 */
29357  {
29358  MAN.spi_write_complete_flag = false ; /* reset the flag.*/
29359  MSG.state = MSG_STATE_SEND_PREAMBLE ; /* Move on send the message preamble.*/
29360  PRE_MSG.state = PREAMBLE_STATE_SEND_TICKLE ; /* Set the PRE_MSG state machine to its initial state.*/
29361  MAN.spi_sent_flag = false ; /* Reset the flag so we can send data.*/
29362  }
29363  } else ((int)(bitmapstruct.element3 |= (1 << 13))); /* 4 */
29364  }
29365  } else ((int)(bitmapstruct.element3 |= (1 << 14))); /* 4 */
29366  }
29367  ((int)(bitmapstruct.element3 |= (1 << 15))); /* 16 */
29368  goto l129184 ;
29370  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 16) : 0)), 1 ); /* 41 */
29371  /* This state contains the PRE_MSG state machine.*/
29372  {
29373  switch (
29374  ( ( int )( /* 29 */
29375  PRE_MSG.state
29376  ))*
29377  ((bitmapstruct.element3 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 17) : 0)), 1 ) /* 19 */
29378  ) /* This machine controls the sending of the preamble bits.*/
29379  {
29380  case PREAMBLE_STATE_IDLE :
29381  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 18) : 0)), 1 ); /* 41 */
29382  /* Wait here until the next message needs to be sent.*/
29383  {
29384  /* No action occurs here.*/
29385  }
29386  ((int)(bitmapstruct.element3 |= (1 << 19))); /* 16 */
29387  goto l129114 ;
29389  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 20) : 0)), 1 ); /* 41 */
29390  /* Send the first MARK 'tickle' bit.*/
29391  {
29392  ((int)(bitmapstruct.element3 |= (1 << 21))); /* 23 */
29393 
29394  Send_Mark () ;
29395  PRE_MSG.state = PREAMBLE_STATE_NULL ; /* Move on to wait for the null period.*/
29396  }
29397  ((int)(bitmapstruct.element3 |= (1 << 22))); /* 16 */
29398  goto l129114 ;
29399  case PREAMBLE_STATE_NULL :
29400  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
29401  /* Null time between tickle bit and remaining preamble.*/
29402  {
29403  if
29404  (
29405  FSK.tick == true
29406  ) /* If 100uS FSK tick is true,*/
29407  {
29408  ((int)(bitmapstruct.element3 |= (1 << 24))); /* 1 */
29409  {
29410  FSK.tick = false ; /* reset the tick.*/
29411  if
29412  (
29413  FSK.null_count == 25U
29414  ) /* If 2.5mS has passed,*/
29415  {
29416  ((int)(bitmapstruct.element3 |= (1 << 25))); /* 1 */
29417  {
29418  FSK.null_count = 0U ; /* reset the count.*/
29419  PRE_MSG.state = PREAMBLE_STATE_SEND_MARK_1 ; /* Move on to send the first MARK bit.*/
29420  }
29421  ((int)(bitmapstruct.element3 |= (1 << 26))); /* 3 */
29422  }
29423  else /* Otherwise,*/
29424  {
29425  ((int)(bitmapstruct.element3 |= (1 << 27))); /* 2 */
29426  {
29427  FSK.null_count = FSK.null_count + 1U ; /* increment the null timer count.*/
29428  }
29429  }
29430  }
29431  } else ((int)(bitmapstruct.element3 |= (1 << 28))); /* 4 */
29432  }
29433  ((int)(bitmapstruct.element3 |= (1 << 29))); /* 16 */
29434  goto l129114 ;
29436  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
29437  /* Send the first MARK bit of the preamble.*/
29438  {
29439  ((int)(bitmapstruct.element3 |= (1 << 31))); /* 23 */
29440 
29441  Send_Mark () ;
29442  PRE_MSG.state = PREAMBLE_STATE_SEND_MARK_2 ; /* Move on to send the second MARK bit.*/
29443  }
29444  ((int)(bitmapstruct.element4 |= (1 << 0))); /* 16 */
29445  goto l129114 ;
29447  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
29448  /* Send the second MARK bit of the preamble.*/
29449  {
29450  ((int)(bitmapstruct.element4 |= (1 << 2))); /* 23 */
29451 
29452  Send_Mark () ;
29453  PRE_MSG.state = PREAMBLE_STATE_SEND_SPACE ; /* Move on to send the first SPACE bit.*/
29454  }
29455  ((int)(bitmapstruct.element4 |= (1 << 3))); /* 16 */
29456  goto l129114 ;
29458  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ); /* 41 */
29459  /* Send the SPACE bit of the preamble.*/
29460  {
29461  ((int)(bitmapstruct.element4 |= (1 << 5))); /* 23 */
29462 
29463  Send_Space () ;
29466  }
29467  ((int)(bitmapstruct.element4 |= (1 << 6))); /* 16 */
29468  goto l129114 ;
29469  default :
29470  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 7) : 0)), 1 ); /* 41 */
29471  {
29472  /*Comment.*/
29473  }
29474  ((int)(bitmapstruct.element4 |= (1 << 8))); /* 16 */
29475  goto l129114 ;
29476  }
29477 l129114 :
29478  ; /* 18 */
29479  }
29480  ((int)(bitmapstruct.element4 |= (1 << 9))); /* 16 */
29481  goto l129184 ;
29482  case MSG_STATE_SEND_MESSAGE :
29483  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 10) : 0)), 1 ); /* 41 */
29484  {
29485  int8_t
29486  bit_position ;
29487  for
29488  (
29489  bit_position = ( int8_t ) MSG.length
29490  ;
29491  ( /* 28 */
29492  bit_position >= 0
29493  ) /* 7 */
29494  ;
29495  ( /* 7 */
29496  bit_position --
29497  , ((int)(bitmapstruct.element4 |= (1 << 11))) /* 27b */
29498  , ((int)(bitmapstruct.element4 |= (1 << 12)))) /* 27e */
29499  ) /* For loop required to maintain proper FSK timing to PerfSwitch.*/
29500  {
29501  { /* 32 */
29502  int QZZZ = ((int)(bitmapstruct.element4 |= (1 << 13))); /* 32 */
29503  /* This cannot be set up like the preamble. This is sent MSB first.*/
29504  /* LDRA_INSPECTED 403 S
29505 */ /* bit_position will not be a negative number.*/
29506  if
29507  (
29508  (
29509  (
29510  ( MSG.command ) & ( 1U << ( bit_position ) ) ) != 0U ) == 0x01U
29511  ) /* If the bit in the message is a one,*/
29512  {
29513  ((int)(bitmapstruct.element4 |= (1 << 14))); /* 1 */
29514  {
29515  ((int)(bitmapstruct.element4 |= (1 << 15))); /* 23 */
29516 
29517  Send_Mark () ; /* send an FSK one.*/
29518  }
29519  ((int)(bitmapstruct.element4 |= (1 << 16))); /* 3 */
29520  }
29521  else /* Otherwise,*/
29522  {
29523  ((int)(bitmapstruct.element4 |= (1 << 17))); /* 2 */
29524  {
29525  ((int)(bitmapstruct.element4 |= (1 << 18))); /* 23 */
29526 
29527  Send_Space () ; /* send an FSK zero.*/
29528  }
29529  }
29530  ((int)(bitmapstruct.element4 |= (1 << 19))); /* 6 */
29531  }
29532  }
29533  ((int)(bitmapstruct.element4 |= (1 << 20))); /* 5 */
29534  ((int)(bitmapstruct.element4 |= (1 << 21))); /* 23 */
29535 
29536  Send_Mark () ; /* Send an extra Mark (Stop bit)or else PerfSwitch won't respond.*/
29537  MSG.state = MSG_STATE_NULL ; /* Move on to wait for a null time.*/
29538  }
29539  ((int)(bitmapstruct.element4 |= (1 << 22))); /* 16 */
29540  goto l129184 ;
29541  case MSG_STATE_NULL :
29542  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 23) : 0)), 1 ); /* 41 */
29543  /* Null time after last bit.*/
29544  {
29545  if
29546  (
29547  FSK.tick == true
29548  ) /* If 100uS FSK tick is true,*/
29549  {
29550  ((int)(bitmapstruct.element4 |= (1 << 24))); /* 1 */
29551  {
29552  FSK.tick = false ; /* reset the tick.*/
29553  if
29554  (
29555  FSK.null_count == 25U
29556  ) /* If 2.5mS has passed,*/
29557  {
29558  ((int)(bitmapstruct.element4 |= (1 << 25))); /* 1 */
29559  {
29560  FSK.null_count = 0U ; /* reset the count.*/
29561  MSG.state = MSG_STATE_IDLE ; /* Move on to wait for another message to send.*/
29562  FSK.send_message_complete_flag = true ; /* Flag to indicate that we have completed sending the FSK message.*/
29563  }
29564  ((int)(bitmapstruct.element4 |= (1 << 26))); /* 3 */
29565  }
29566  else /* Otherwise,*/
29567  {
29568  ((int)(bitmapstruct.element4 |= (1 << 27))); /* 2 */
29569  {
29570  FSK.null_count = FSK.null_count + 1U ; /* increment the null timer count.*/
29571  }
29572  }
29573  }
29574  } else ((int)(bitmapstruct.element4 |= (1 << 28))); /* 4 */
29575  }
29576  ((int)(bitmapstruct.element4 |= (1 << 29))); /* 16 */
29577  goto l129184 ;
29578  default :
29579  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
29580  {
29581  /*Comment.*/
29582  }
29583  ((int)(bitmapstruct.element4 |= (1 << 31))); /* 16 */
29584  goto l129184 ;
29585  }
29586 l129184 :
29587  ; /* 18 */
29588  ((int)(bitmapstruct.element5 |= (1 << 0))); /* 30 */
29589  fsk_60zqendz ( 161 ) ; /* 30 */
29590  }
29591 /*!*************************************************************************************
29592  Function:
29593  static void Send_Space( void )
29594  Summary:
29595  This function sends a FSK 0 or 'SPACE'. It is called from the Send_Message_Task
29596  function.
29597  Remarks:
29598  Refer to the fsk.h interface header for function usage details.
29599  */
29600 
29601 static void
29602  Send_Space ( void )
29603  {
29604  int izzqqzz=((int)(bitmapstruct.element5 |= (1 << 1))); /* 37 */
29605  uint16_t
29606  cnt1 ;
29607  for
29608  (
29609  cnt1 = 0U
29610  ;
29611  ( /* 28 */
29612  cnt1 < sizeof ( TimeSpace )
29613  ) /* 7 */
29614  ;
29615  ( /* 7 */
29616  cnt1 ++
29617  , ((int)(bitmapstruct.element5 |= (1 << 2))) /* 27b */
29618  , ((int)(bitmapstruct.element5 |= (1 << 3)))) /* 27e */
29619  )
29620  {
29621  { /* 32 */
29622  int QZZZ = ((int)(bitmapstruct.element5 |= (1 << 4))); /* 32 */
29623  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 ) ;/* Bring the chip select line low.*/
29624  DRV_PMP0_Write ( Xmit00[ cnt1 ] ) ;/* Update the DAC value for generating the FSK "Space" sine wave.*/
29625  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 ) ;/* Bring the chip select line high.*/
29626  DRV_TMR2_CounterClear () ;/* Reset the timer.*/
29627  ( void ) DRV_TMR2_Start () ;
29628  /* Start the timer again.*/
29629  /* LDRA_INSPECTED 28 D
29630 */ /* No infinite loop.*/
29631  while
29632  (
29633  ( /* 21 */
29634  DRV_TMR2_CounterValueGet () < ( uint32_t ) TimeSpace[ cnt1 ]
29635  ) /* 7 */
29636  ) /* Wait until the timer is greater than the TimeSpace value.*/
29637  {
29638  { /* 32 */
29639  int zzqqzs = ((int)(bitmapstruct.element5 |= (1 << 5))); /* 32a */
29640  /*Comment.*/
29641  ((int)(bitmapstruct.element5 |= (1 << 6))); /* 6 */
29642  }
29643  }
29644  ((int)(bitmapstruct.element5 |= (1 << 7))); /* 5 */
29645  ((int)(bitmapstruct.element5 |= (1 << 8))); /* 6 */
29646  }
29647  }
29648  ((int)(bitmapstruct.element5 |= (1 << 9))); /* 5 */
29649  ((int)(bitmapstruct.element5 |= (1 << 10))); /* 30 */
29650  fsk_60zqendz ( 171 ) ; /* 30 */
29651  }
29652 /*!*************************************************************************************
29653  Function:
29654  static void Send_Mark( void )
29655  Summary:
29656  This function sends a FSK 1 or 'MARK'. It is called from the Send_Message_Task
29657  function.
29658  Remarks:
29659  Refer to the fsk.h interface header for function usage details.
29660  */
29661 
29662 static void
29663  Send_Mark ( void )
29664  {
29665  int izzqqzz=((int)(bitmapstruct.element5 |= (1 << 11))); /* 37 */
29666  uint16_t
29667  cnt1 ;
29668  for
29669  (
29670  cnt1 = 0U
29671  ;
29672  ( /* 28 */
29673  cnt1 < sizeof ( TimeMark )
29674  ) /* 7 */
29675  ;
29676  ( /* 7 */
29677  cnt1 ++
29678  , ((int)(bitmapstruct.element5 |= (1 << 12))) /* 27b */
29679  , ((int)(bitmapstruct.element5 |= (1 << 13)))) /* 27e */
29680  )
29681  {
29682  { /* 32 */
29683  int QZZZ = ((int)(bitmapstruct.element5 |= (1 << 14))); /* 32 */
29684  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 ) ;/* Bring the chip select line low.*/
29685  DRV_PMP0_Write ( Xmit11[ cnt1 ] ) ;/* Update the DAC value for generating the FSK "Mark" sine wave.*/
29686  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 ) ;/* Bring the chip select line high.*/
29687  DRV_TMR2_CounterClear () ;/* Reset the Timer 2 count.*/
29688  ( void ) DRV_TMR2_Start () ;
29689  /* Start the timer again.*/
29690  /* LDRA_INSPECTED 28 D
29691 */ /* No infinite loop.*/
29692  while
29693  (
29694  ( /* 21 */
29695  DRV_TMR2_CounterValueGet () < ( uint32_t ) TimeMark[ cnt1 ]
29696  ) /* 7 */
29697  ) /* Wait until Timer 2 reaches the TimeMark value.*/
29698  {
29699  { /* 32 */
29700  int zzqqzs = ((int)(bitmapstruct.element5 |= (1 << 15))); /* 32a */
29701  /*Comment.*/
29702  ((int)(bitmapstruct.element5 |= (1 << 16))); /* 6 */
29703  }
29704  }
29705  ((int)(bitmapstruct.element5 |= (1 << 17))); /* 5 */
29706  ((int)(bitmapstruct.element5 |= (1 << 18))); /* 6 */
29707  }
29708  }
29709  ((int)(bitmapstruct.element5 |= (1 << 19))); /* 5 */
29710  ((int)(bitmapstruct.element5 |= (1 << 20))); /* 30 */
29711  fsk_60zqendz ( 181 ) ; /* 30 */
29712  }
29713 /*!*************************************************************************************
29714  Function:
29715  void Generate_Sine_Wave_Data( float NoOfTicks )
29716  Summary:
29717  This function stores sine wave inter step time values into two arrays at
29718  initialization and if the FSK frequency needs to be adjusted.
29719  Remarks:
29720  Refer to the fsk.h interface header for function usage details.
29721  */
29722 
29723 void
29725  float32_t NoOfTicks )
29726  {
29727  int izzqqzz=((int)(bitmapstruct.element5 |= (1 << 21))); /* 37 */
29728  uint8_t
29729  mark ;
29730  uint8_t
29731  space ;
29732  errorMark = ( FSK.mark_count * NoOfTicks ) ;/* Calculate the new FSK 'MARK' count.*/
29733  errorSpace = ( FSK.space_count * NoOfTicks ) ;
29734  /* Calculate the new FSK 'SPACE' count.*/
29735  /* LDRA_INSPECTED 124 D
29736 */ /* No need to check return from rounding function.*/
29737  mark = ( uint8_t ) rint ( errorMark ) ;
29738  /* Round the errorMark result to the nearest integer.*/
29739  /* LDRA_INSPECTED 124 D
29740 */
29741  space = ( uint8_t ) rint ( errorSpace ) ;
29742  /* Round the errorSpace result to the nearest integer.*/
29743  /* LDRA_INSPECTED 489 S
29744 */ /* Proper use of memset function.*/
29745  ( void ) memset ( TimeMark , mark , sizeof ( TimeMark ) ) ;
29746  /* Update the TimeMark array with the new mark value.*/
29747  /* LDRA_INSPECTED 489 S
29748 */ /* Proper use of memset function.*/
29749  ( void ) memset ( TimeSpace , space , sizeof ( TimeSpace ) ) ;/* Update the TimeSpace array with the new space value.*/
29750  ((int)(bitmapstruct.element5 |= (1 << 22))); /* 30 */
29751  fsk_60zqendz ( 183 ) ; /* 30 */
29752  }
29753 #define qqqbranches 183
29754 #define QQQMAXMCDCSIZE 2
29755 /********************** LDRA_PORT INSTRUMENTATION **********************/
29756 
29757 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
29758 #define ldra_sscanf
29759  /* put in undefs to protect our parameter names from macros */
29760 #undef f
29761 #undef i
29762 #undef j
29763 #undef k
29764 #undef s
29765 #undef l
29766 #undef ii
29767 #undef some
29768 #undef none
29769 #undef from
29770 #undef a
29771 #undef b
29772 #undef iz
29773 #undef jz
29774 #undef qqnull_params
29775 #define qqnull_params void
29776  /* Conventional Instrumentation */
29777 #define qqzzidfield 1
29778  /* single file or fileid */
29779  /* these have an extra field for the fileid */
29780  static char qqqqone[] = "%6d\n"; /* single point */
29781  /* uncompressed data structures */
29782  /* uncompressed bitmap */
29783 #define QQQFIXEDSIZE
29784  static int qqqlast = 0;
29785  extern int qqupload_registered;
29786  extern int fsk_60zqqzqz(qqnull_params);
29787  extern int fsk_60zqqzqz1(qqnull_params);
29788  /* ----------------------------------------------------------------------* 200 *
29789  * Procedures
29790  * -----------------------------------------------------------------------------
29791  */
29792  /* ----------- zscanf ---------------------------------------------------* 201 *
29793  * Returns an integer extracted from a string
29794  * -----------------------------------------------------------------------------
29795  */
29796  static int fsk_60zscanf(char * qqscan_str)
29797  {
29798  int qqvalue;
29799  int qqisign;
29800  char * qqcptr;
29801  qqvalue = 0;
29802  qqisign = 1;
29803  qqcptr = qqscan_str;
29804  /* Skip spaces */
29805  while (qqcptr[0] == ' ')
29806  {
29807  qqcptr++;
29808  }
29809  /* Check for a leading ---
29810  */
29811  if (qqcptr[0] == '-')
29812  {
29813  qqisign = -1;
29814  qqcptr++;
29815  }
29816  /* Extract digits */
29817  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
29818  {
29819  qqvalue = 10 * qqvalue;
29820  qqvalue = qqvalue + (qqcptr[0] - '0');
29821  qqcptr++;
29822  }
29823  qqvalue = qqisign * qqvalue;
29824  return qqvalue;
29825  } /* end of zscanf */
29826  /* ----------------------------------------------------------------------* 210 *
29827  * C System utilities in use:
29828  * fprintf
29829  * fclose
29830  * sscanf
29831  * -----------------------------------------------------------------------------
29832  */
29833  /* ----------------------------------------------------------------------* 213 *
29834  * qqoutput* suite
29835  * Main output routines. These may require modification.
29836  * -----------------------------------------------------------------------------
29837  */
29838  /* ----------------------------------------------------------------------* 214 *
29839  * qqoutput
29840  * This is the principle output routine.
29841  * -----------------------------------------------------------------------------
29842  */
29843  static void qqoutput(FILEPOINT char * s,int i)
29844  /* f - file pointer, s - format string, i - integer for probe value */
29845  {
29846  /* printing to a file */
29847  /* fprintf exists, not threaded */
29848  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
29849  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
29850  ldra_port_write (&ldra_buffer[0]);
29851  } /* end of qqoutput */
29852  /* ----------------------------------------------------------------------* 215 *
29853  * qqoutput0
29854  * -----------------------------------------------------------------------------
29855  */
29856  static void qqoutput0(FILEPOINT char * s)
29857  {
29858  ldra_port_write(s);
29859  } /* end of qqoutput0 */
29860  /* ----------------------------------------------------------------------* 216 *
29861  * qqoutput2
29862  * -----------------------------------------------------------------------------
29863  */
29864  static void qqoutput2(FILEPOINT char * s,int i, int j)
29865  {
29866  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
29867  ldra_port_write (&ldra_buffer[0]);
29868  } /* end of qqoutput2 */
29869  /* ----------------------------------------------------------------------* 217 *
29870  * qqoutput3
29871  * -----------------------------------------------------------------------------
29872  */
29873  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
29874  {
29875  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
29876  ldra_port_write (&ldra_buffer[0]);
29877  } /* end of qqoutput3 */
29878  /* ----------------------------------------------------------------------* 218 *
29879  * qqoutput4
29880  * -----------------------------------------------------------------------------
29881  */
29882  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
29883  {
29884  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
29885  ldra_port_write (&ldra_buffer[0]);
29886  } /* end of qqoutput4 */
29887  /* ----------------------------------------------------------------------* 219 *
29888  * end of qqoutput* suite
29889  * -----------------------------------------------------------------------------
29890  */
29891  /* ----------------------------------------------------------------------* 222 *
29892  * qqqqinitialise
29893  * This procedure initialises the structures for
29894  * compressed execution histories.
29895  * -----------------------------------------------------------------------------
29896  */
29897  static void qqqqinitialise(int ii)
29898  {
29899  unsigned int i;
29900  /* First time through. */
29901  /* bitmap */
29902  /* bitmap separate */
29903  qqqlast = 1; /* stops qqfun() calling initialise again */
29904  /* bitmap */
29905  /* bitmap singlefile */
29906  /* struct singlefile notmainfl */
29907  } /* end of qqqqinitialise */
29908 /* ----------------------------------------------------------------------* 225 *
29909 * qqqbitmapreset
29910 * This procedure resets the structures for
29911 * compressed execution histories.
29912 * -----------------------------------------------------------------------------
29913 */
29914 static void qqqbitmapreset()
29915 {
29916 struct bitmapstruct_t localbitmap = {0};
29917 bitmapstruct = localbitmap;
29918 } /* end of qqqbitmapreset */
29919 #undef QQQTEMP1
29920 #define QQQTEMP1
29921  /* ----------- zqqzqz ---------------------------------------------------* 310 *
29922  * -----------------------------------------------------------------------------
29923  */
29924  /* ----------------------------------------------------------------------* 312 *
29925  * This routine opens the execution history file. It is instrumented at the
29926  * start of the main program if one exists in the file. In general this is
29927  * superceded by fsk_60zqqzqz1 below.
29928  * -----------------------------------------------------------------------------
29929  */
29931  {
29932  if ( fsk_60zzopen != 1 )
29933  {
29934 #undef QQQMUSTOPEN
29935  fsk_60zzopen = 1;
29936  }
29937  return(1);
29938  } /* end of zqqzqz */
29939  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
29940  * -----------------------------------------------------------------------------
29941  */
29942  /* ----------------------------------------------------------------------* 317 *
29943  * This routine also opens the execution history file. It is called
29944  * automatically if a probe fires and the execution history is not already
29945  * opened (fsk_60zzopen = 0 ).
29946  * Because this always works ( it was intended for files with no main program
29947  * it is now the de facto common way to open the execution history.
29948  * -----------------------------------------------------------------------------
29949  */
29951  {
29952  if ( fsk_60zzopen != 1 )
29953  {
29954  ldra_port_open(); /* 7 */
29955  qqqqinitialise(0);
29956  fsk_60zzopen = 1;
29957  }
29958  return(1);
29959  } /* end of zqqzqz1 */
29960  /* ----------- zqendz ---------------------------------------------------* 330 *
29961  * This routine is called on exiting a routine in a
29962  * module. It closes the execution history.
29963  * -----------------------------------------------------------------------------
29964  */
29965 static int fsk_60zqendz(int qqqi)
29966  {
29967  if (!qqqstructzzopen)
29968  {
29970  qqqstructzzopen = 1;
29971  }
29972  if ( fsk_60zzopen != 1 )
29973  {
29974  fsk_60zqqzqz1();
29975  }
29976  /* ----------------------------------------------------------------------* 331 *
29977  * this is the one which puts an integer into
29978  * the execution history file and returns unity.
29979  * The format of each field consists of six columns,
29980  * the number is right justified in this field.
29981  * -----------------------------------------------------------------------------
29982  */
29983  if ( fsk_60zzopen )
29984  {
29985  /* uncompressed */
29986  /* uncompressed unbuffered */
29987  /* uncompressed unbuffered bitmap */
29988  if ( qqqi > 0 )
29989  {
29990  }
29991  else
29992  {
29993  }
29994  }
29995  qqqlast = 0;
29996  return(1);
29997  } /* end of zqendz */
29998  /* ----------------------------------------------------------------------* 335 *
29999  * Output structure - qqbmsoutput
30000  * -----------------------------------------------------------------------------
30001  */
30002  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
30003  {
30004  static int branches_printed = 0;
30005  int b, last = 0;
30006  for(b=0;b<qqqqbmselwidth/8;b++)
30007  {
30008  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
30009  ldra_port_write (&ldra_buffer[0]);
30010  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
30011  ldra_port_write (&ldra_buffer[0]);
30012  last += 8;
30013  branches_printed += 8;
30014  if (branches_printed >= qqqbranches)
30015  {
30016  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
30017  break;
30018  }
30019  }
30020  }
30021  /* ----------------------------------------------------------------------* 336 *
30022  * qqqupload
30023  * This routine loops through the stored bitmap and
30024  * outputs it. It then uploads the stored mcdc.
30025  * -----------------------------------------------------------------------------
30026  */
30027  static void qqqupload(qqnull_params)
30028  {
30029  int i;
30030  /* uncompressed bitmap (!singlefile or mainfl) separate */
30031  {
30032  fsk_60zqqzqz1();
30033 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
30034 #define LASTELEMENT
30035 #include "fsk_60zbelem.def"
30036 #undef LASTELEMENT
30037 #undef ELEMENT
30038  }
30039  /* bitmap separate */
30040  qqqlast = 1; /* stops qqfun() calling initialise again */
30041  } /* end of qqqupload */
30042  /* ----------- zqzqzq ---------------------------------------------------* 342 *
30043  * -----------------------------------------------------------------------------
30044  */
30045  /* ----------------------------------------------------------------------* 344 *
30046  * This routine should be called before the program
30047  * terminates. It closes the execution history
30048  * -----------------------------------------------------------------------------
30049  */
30050  static int fsk_60zqzqzq(int qqqi)
30051  {
30052  if ( fsk_60zzopen != 1 )
30053  {
30054  fsk_60zqqzqz1();
30055  }
30056  /* not compressed */
30057  /* do nothing for bitmap*/
30058  /* upload the history */
30059  /* bitmap */
30060  /* uncompressed bitmap */
30061  fsk_60zqendz(qqqi);
30062  /* qqqupload closes the execution history file */
30063  return(1);
30064  } /* end of zqzqzq */
30065  /* the following routines should be left alone */
30066 /* END OF TESTBED INSTRUMENTATION */
30067 
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
static void DRV_TMR4_Tasks(void)
Definition: inszt_fsk.c:4135
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
static void DRV_TMR4_Close(void)
Definition: inszt_fsk.c:4095
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
static SYS_STATUS DRV_TMR2_Status(void)
Definition: inszt_fsk.c:3843
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
Definition: inszt_fsk.c:3975
void PLIB_DMA_Enable(DMA_MODULE_ID index)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
static int QQQfirstmcdc
Definition: inszt_fsk.c:76
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
void DRV_TMR2_CounterValueSet(uint32_t value)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
static void Send_Message_Tasks(void)
Definition: inszt_fsk.c:29299
DRV_USART_BUFFER_EVENT
Definition: inszt_fsk.c:15006
void PLIB_SPI_Enable(SPI_MODULE_ID index)
void DRV_TMR2_CounterClear(void)
void PLIB_DMA_Disable(DMA_MODULE_ID index)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
TMultiValue MESSAGE
Definition: inszt_fsk.c:29026
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
MAN_RX_STATES
Definition: inszt_fsk.c:28295
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
static const uint8_t Xmit11[312]
Definition: inszt_fsk.c:27777
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static char qqqqone[]
Definition: inszt_fsk.c:29780
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
static void Init_WL_CPS(void)
DRV_USART_INIT_FLAGS
Definition: inszt_fsk.c:15274
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
void DRV_ADC_Start(void)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void DRV_TMR3_Stop(void)
uint32_t command
Definition: fsk.h:173
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
float float32_t
Definition: cf.h:50
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
#define QQQnumfil
Definition: inszt_fsk.c:51
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
static void Test_Manchester(void)
uint8_t Calc_CRC_Array(uint16_t Count, const uint8_t Bytes [])
Definition: crc.c:92
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void qqqbitmapreset(qqnull_params)
void DRV_ADC0_Open(void)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
#define fsk_60zzopen
Definition: inszt_fsk.c:77
static unsigned char qqqzzglobflag
Definition: inszt_fsk.c:167
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t DRV_PMP0_Read(void)
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
Definition: inszt_fsk.c:30002
MSG_DATA MSG
Definition: inszt_fsk.c:29032
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
static void DRV_TMR0_Open(void)
Definition: inszt_fsk.c:3634
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
#define qqqbranches
Definition: inszt_fsk.c:29753
DRV_SPI_BUFFER_EVENT
Definition: inszt_fsk.c:26309
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
void APP_Tasks(void)
Definition: app.c:130
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
DRV_IO_BUFFER_TYPES
Definition: inszt_fsk.c:986
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void Set_WL_CPS_CurrentLimit(uint8_t value)
DRV_USART_ERROR
Definition: inszt_fsk.c:15336
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
static void Send_Mark(void)
Definition: inszt_fsk.c:29663
static void qqoutput0(FILEPOINT char *s)
Definition: inszt_fsk.c:29856
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
static void qqqqinitialise(int ii)
Definition: inszt_fsk.c:29897
APP_DATA APP
Definition: app.c:73
static void qqoutput(FILEPOINT char *s, int i)
Definition: inszt_fsk.c:29843
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void DRV_IC0_Initialize(void)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_fsk.c:21774
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
static void Decode_Manchester(void)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
void DRV_TMR0_StopInIdleDisable(void)
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
MAN_PROCESS_STATES
Definition: inszt_app.c:29386
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
static bool Check_Manchester(void)
void DRV_PMP0_ModeConfig(void)
float32_t baud
Definition: fsk.h:86
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
void DRV_TMR1_CounterClear(void)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
static int qqqisinitialised
Definition: inszt_main.c:152
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
bool send_message_complete_flag
Definition: fsk.h:84
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uint8_t crc
Definition: fsk.h:82
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
DRV_CLIENT_STATUS
Definition: inszt_fsk.c:929
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
void PLIB_USART_Disable(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
FSK_DATA FSK
Definition: inszt_fsk.c:29029
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t byte[4]
Definition: fsk.h:103
SYS_DMA_CHANNEL_CHAIN_PRIO
Definition: inszt_fsk.c:13205
static SYS_STATUS DRV_TMR1_Status(void)
Definition: inszt_fsk.c:3733
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
void DRV_TMR1_CounterValueSet(uint32_t value)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t length
Definition: fsk.h:174
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
DRV_ADC_MODULE_ID
Definition: inszt_fsk.c:1419
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
static void DRV_TMR0_DeInitialize(void)
Definition: inszt_fsk.c:3614
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
SYSTEM_OBJECTS sysObj
static int fsk_60zscanf(char *qqscan_str)
Definition: inszt_fsk.c:29796
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_Enable(USART_MODULE_ID index)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
Definition: fsk.h:123
uint32_t PORTS_DATA_TYPE
Definition: inszt_fsk.c:18442
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
bool DRV_USART0_TransmitBufferIsFull(void)
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
DRV_USART_HANDSHAKE
Definition: inszt_fsk.c:15151
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
void Generate_Sine_Wave_Data(float32_t NoOfTicks)
Definition: inszt_fsk.c:29724
static SYS_STATUS DRV_TMR3_Status(void)
Definition: inszt_fsk.c:3953
void DRV_TMR4_Stop(void)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
MSG_STATES
Definition: inszt_fsk.c:27706
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
bool DRV_TMR1_Start(void)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
void DRV_TMR3_CounterValueSet(uint32_t value)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
float32_t space_count
Definition: fsk.h:89
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_TMR1_PeriodValueSet(uint32_t value)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
void DRV_SPI_Close(DRV_HANDLE handle)
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
WL_CPS_STATES
Definition: inszt_app.c:28620
void MAN_Tasks(void)
Definition: inszt_man.c:29645
SYS_DMA_DATA_WIDTH
Definition: inszt_fsk.c:13432
DRV_USART_CLIENT_STATUS
Definition: inszt_fsk.c:15374
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
static SYS_STATUS DRV_TMR4_Status(void)
Definition: inszt_fsk.c:4063
void DRV_TMR2_PeriodValueSet(uint32_t value)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_IC0_Stop(void)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_ADC0_Close(void)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
static int qqqlast
Definition: inszt_fsk.c:29784
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
Definition: inszt_fsk.c:29882
bool DRV_TMR2_Start(void)
PREAMBLE_STATES state
Definition: fsk.h:219
bool spi_write_complete_flag
Definition: inszt_app.c:29418
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
uint32_t baudRate
Definition: inszt_adc.c:26572
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
void DRV_TMR3_StopInIdleEnable(void)
FSK_STATES
Definition: inszt_fsk.c:27622
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
DRV_SPI_CLOCK_MODE
Definition: inszt_fsk.c:26209
void DRV_TMR3_CounterClear(void)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
Definition: inszt_fsk.c:3755
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
void DRV_IC0_Start(void)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
MAN_DATA MAN
Definition: man.c:67
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
int qqupload_registered
Definition: inszt_main.c:6760
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
static void MAN_PROCESS_Tasks(void)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
Definition: inszt_fsk.c:1838
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
static int zzfileid
Definition: inszt_fsk.c:50
DRV_TMR_CLK_SOURCES
Definition: inszt_fsk.c:1604
void DRV_TMR3_StopInIdleDisable(void)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
static struct bitmapstruct_t bitmapstruct
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static SYS_STATUS DRV_TMR0_Status(void)
Definition: inszt_fsk.c:3623
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
uint8_t Get_CRC_Value(void)
Definition: crc.c:157
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
static void qqqupload(qqnull_params)
Definition: inszt_fsk.c:30027
bool SYS_DMA_IsBusy(void)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
WL_CPS_STATES
Definition: inszt_fsk.c:28777
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
uint16_t DRV_IC0_Capture16BitDataRead(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
MAN_PROCESS_STATES
Definition: inszt_fsk.c:28311
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
void DRV_TMR3_Initialize(void)
void WL_CPS_Tasks(void)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
bool tick
Definition: fsk.h:85
uint32_t DRV_TMR0_CounterValueGet(void)
MAN_BIAS_DATA MAN_BIAS
Definition: man.c:65
static int fsk_60zqqzqz(qqnull_params)
Definition: inszt_fsk.c:29930
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint32_t DRV_TMR2_CounterFrequencyGet(void)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static void DRV_TMR1_Tasks(void)
Definition: inszt_fsk.c:3805
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_fsk.c:21813
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
SYS_ERROR_LEVEL
Definition: inszt_fsk.c:17458
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR4_CounterClear(void)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
uint8_t identifier
Definition: fsk.h:125
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
void MAN_RX_Tasks(void)
Definition: inszt_man.c:29829
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
void DRV_TMR_Stop(DRV_HANDLE handle)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
PREAMBLE_STATES
Definition: inszt_fsk.c:27746
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
static int qqqqbmselwidth
Definition: inszt_fsk.c:49
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_IO_INTENT
Definition: inszt_adc.c:975
MSG_STATES state
Definition: fsk.h:172
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR0_Stop(void)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
void Reset_CRC_Value(void)
Definition: crc.c:141
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
void DRV_TMR1_Initialize(void)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
Definition: inszt_fsk.c:15138
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR0_PeriodValueSet(uint32_t value)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
static void DRV_TMR4_DeInitialize(void)
Definition: inszt_fsk.c:4054
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_fsk.c:26277
DOWN_MSG DWNMSG
Definition: inszt_fsk.c:29023
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
Definition: fsk.h:170
void DRV_ADC1_Open(void)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR2_Stop(void)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_fsk.c:21798
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
uint32_t DRV_TMR0_PeriodValueGet(void)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
MAN_STATES
Definition: inszt_fsk.c:28275
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
MAN_STATES
Definition: inszt_app.c:29350
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
Definition: fsk.h:217
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
uint32_t DRV_TMR3_PeriodValueGet(void)
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
Definition: inszt_fsk.c:26425
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
DRV_HANDLE spi_bias_fsk
Definition: inszt_app.c:29445
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
WL_CPS_DATA WL_CPS
Definition: wl_cps.c:56
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
static volatile float32_t errorMark
Definition: inszt_fsk.c:29049
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
void DRV_USART0_TasksReceive(void)
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
static void DRV_TMR2_Tasks(void)
Definition: inszt_fsk.c:3915
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
void DRV_TMR0_CounterValueSet(uint32_t value)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
void(* ldra_void_function)()
Definition: inszt_fsk.c:115
Definition: fsk.h:78
void FSK_Tasks(void)
Definition: inszt_fsk.c:29067
void DRV_USART0_Deinitialize(void)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
void DRV_TMR1_StopInIdleEnable(void)
uint32_t DRV_TMR2_PeriodValueGet(void)
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_fsk.c:13245
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
uint32_t DRV_TMR1_CounterFrequencyGet(void)
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
uint16_t PORTS_DATA_MASK
Definition: inszt_fsk.c:18429
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
void DRV_USART0_Close(void)
uint8_t trynumber
Definition: inszt_app.c:29416
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
void DRV_TMR0_Initialize(void)
#define FILEPOINT
Definition: inszt_fsk.c:92
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
bool DRV_TMR_Start(DRV_HANDLE handle)
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
void DRV_ADC_Stop(void)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
float32_t mark_count
Definition: fsk.h:88
void APP_Initialize(void)
Definition: app.c:93
bool DRV_SPIn_TransmitterBufferIsFull(void)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART0_WriteByte(const uint8_t byte)
uint8_t msg_length
Definition: fsk.h:127
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_fsk.c:13268
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
Definition: inszt_fsk.c:29873
uint32_t dword
Definition: fsk.h:101
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
uint32_t DRV_TMR3_CounterValueGet(void)
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
static void DRV_TMR1_Open(void)
Definition: inszt_fsk.c:3744
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
Definition: inszt_fsk.c:15106
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
uint32_t DRV_IC0_Capture32BitDataRead(void)
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
bool spi_sent_flag
Definition: inszt_app.c:29419
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
static void Init_FSK(void)
Definition: inszt_fsk.c:29267
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
void SYS_DEBUG_Print(const char *format,...)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
DRV_USART_ERROR
Definition: inszt_adc.c:15426
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
MAN_STATES state
Definition: inszt_app.c:29407
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
static void DRV_TMR1_Close(void)
Definition: inszt_fsk.c:3765
DRV_TMR_OPERATION_MODE
Definition: inszt_fsk.c:1758
uint8_t queueSize
Definition: inszt_adc.c:26592
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
static int fsk_60zqendz(int qqqi)
Definition: inszt_fsk.c:29965
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
int qqqshell_upload
Definition: inszt_main.c:150
static void DRV_TMR0_Close(void)
Definition: inszt_fsk.c:3655
static void DRV_TMR2_DeInitialize(void)
Definition: inszt_fsk.c:3834
static void DRV_TMR2_Open(void)
Definition: inszt_fsk.c:3854
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_fsk.c:13226
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void DRV_TMR1_StopInIdleDisable(void)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_fsk.c:13379
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static void DRV_TMR1_DeInitialize(void)
Definition: inszt_fsk.c:3724
void Set_Bias(uint8_t value)
Definition: inszt_man.c:30592
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
uintptr_t DRV_HANDLE
Definition: inszt_fsk.c:1018
bool DRV_SPIn_ReceiverBufferIsFull(void)
static int fsk_60zqzqzq(int qqqi)
Definition: inszt_fsk.c:30050
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
static uint8_t TimeMark[312]
Definition: inszt_fsk.c:29043
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
uint32_t DRV_TMR4_PeriodValueGet(void)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_fsk.c:13159
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
DRV_SPI_BUFFER_TYPE
Definition: inszt_fsk.c:26254
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
int QQQfcn_ptr_num
Definition: inszt_main.c:151
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void DRV_TMR0_CounterClear(void)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
uint32_t DRV_TMR1_CounterValueGet(void)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
void DRV_TMR4_Initialize(void)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
bool DRV_IC0_BufferIsEmpty(void)
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
#define qqnull_params
Definition: inszt_fsk.c:29775
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_fsk.c:13291
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
static void DRV_TMR2_Close(void)
Definition: inszt_fsk.c:3875
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
static void Flush_Buffer_Manchester(void)
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
void SYS_PORTS_Initialize()
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
PREAMBLE_STATES
Definition: fsk.h:191
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
SYS_DMA_ERROR
Definition: inszt_fsk.c:13401
PRE_DATA PRE_MSG
Definition: inszt_fsk.c:29035
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
void DRV_TMR4_CounterValueSet(uint32_t value)
void DRV_TMR2_StopInIdleEnable(void)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_fsk.c:13185
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
uint8_t Calc_CRC_Uplink(uint16_t Count, const uint8_t Bytes [])
Definition: crc.c:116
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_fsk.c:14945
uint8_t DRV_USART0_ReadByte(void)
static void Package_Manchester(void)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
static void Read_WL_CPS_V_I(void)
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
void DRV_TMR0_StopInIdleEnable(void)
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
static volatile float32_t errorSpace
Definition: inszt_fsk.c:29049
static void Send_Space(void)
Definition: inszt_fsk.c:29602
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
unsigned char uchar8_t
Definition: inszt_fsk.c:28052
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_LINE_CONTROL
Definition: inszt_fsk.c:15225
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
Definition: inszt_fsk.c:3865
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_fsk.c:15176
static void DRV_TMR3_Open(void)
Definition: inszt_fsk.c:3964
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_IC_Stop(DRV_HANDLE handle)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
void SYS_DMA_Resume(void)
void SYS_DMA_Suspend(void)
void DRV_ADC1_Close(void)
void DRV_ADC_Initialize(void)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
void DRV_TMR4_StopInIdleDisable(void)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
#define fsk_60zqqzqz1
Definition: inszt_fsk.c:79
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
void DRV_USART_Close(const DRV_HANDLE handle)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
void DRV_TMR2_StopInIdleDisable(void)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
Definition: app.h:59
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static void DRV_TMR4_Open(void)
Definition: inszt_fsk.c:4074
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
SYS_ERROR_LEVEL gblErrLvl
static uint8_t TimeSpace[168]
Definition: inszt_fsk.c:29046
bool manual_bias_flag
Definition: inszt_app.c:29425
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
bool DRV_TMR3_Start(void)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
uint8_t xmit_ready_flag
Definition: fsk.h:128
#define DRV_IC_Close(handle)
Definition: inszt_fsk.c:1328
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
static void DRV_TMR3_Tasks(void)
Definition: inszt_fsk.c:4025
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
DRV_SPI_MODE
Definition: inszt_fsk.c:26331
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
MSG_STATES
Definition: fsk.h:145
static void Init_Manchester(void)
void DRV_USART0_TasksError(void)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
float float32_t
Definition: inszt_fsk.c:27612
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
Definition: inszt_fsk.c:3645
FSK_STATES state
Definition: fsk.h:80
void SYS_DEBUG_Message(const char *message)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_TMR1_Stop(void)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
void Adjust_WL_CPS_Voltage(uint8_t target)
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
MAN_RX_STATES
Definition: inszt_app.c:29370
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
int QQQindicator
Definition: inszt_main.c:104
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
bool DRV_TMR4_Start(void)
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
void DRV_PMP0_Initialize(void)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_fsk.c:15197
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
void DRV_PMP0_Write(uint8_t data)
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
static void DRV_TMR3_Close(void)
Definition: inszt_fsk.c:3985
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
void Calc_Auto_Bias(void)
Definition: inszt_man.c:30558
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_TMR0_Start(void)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
uint8_t null_count
Definition: fsk.h:83
uint32_t DRV_TMR1_PeriodValueGet(void)
DRV_USART_TRANSFER_STATUS
Definition: inszt_fsk.c:15399
void Prepare_Dwn_Msg(uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length)
Definition: inszt_fsk.c:29240
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
static void qqoutput2(FILEPOINT char *s, int i, int j)
Definition: inszt_fsk.c:29864
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
FSK_STATES
Definition: fsk.h:53
struct _DRV_SPI_INIT DRV_SPI_INIT
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_fsk.c:26157
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
uint32_t DRV_TMR2_CounterValueGet(void)
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
uint8_t command
Definition: fsk.h:126
uint32_t DRV_TMR4_CounterValueGet(void)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
static void DRV_TMR3_DeInitialize(void)
Definition: inszt_fsk.c:3944
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
static float32_t Calc_Fsk_Scaling(void)
void DRV_TMR4_StopInIdleEnable(void)
static void DRV_TMR0_Tasks(void)
Definition: inszt_fsk.c:3695
static const uint8_t Xmit00[168]
Definition: inszt_fsk.c:27791
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
DRV_TMR_CLIENT_STATUS
Definition: inszt_fsk.c:1711
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
void DRV_TMR_Close(DRV_HANDLE handle)
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
void DRV_TMR4_PeriodValueSet(uint32_t value)
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
Definition: inszt_fsk.c:4085
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
SYS_STATUS DRV_USART0_Status(void)
void DRV_TMR3_PeriodValueSet(uint32_t value)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
static int tbrun_mode
Definition: inszt_fsk.c:97
float32_t fsk_timer_freq
Definition: fsk.h:87
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_BUFFER_RESULT
Definition: inszt_fsk.c:15028
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
uint32_t SYS_DMA_ChannelCRCGet(void)
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
#define DRV_IC_Open(drvIndex, intent)
Definition: inszt_fsk.c:1327
DRV_SPI_TASK_MODE
Definition: inszt_fsk.c:26354
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
static int qqqstructzzopen
Definition: inszt_fsk.c:137
static void Check_WL_CPS_Over_Current(void)
DRV_IO_INTENT
Definition: inszt_fsk.c:885
DRV_USART_OPERATION_MODE
Definition: inszt_fsk.c:14969
void DRV_ADC_DeInitialize(void)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void DRV_USART0_TasksTransmit(void)
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
void Calc_CRC(uint16_t nbits, uint8_t thebits)
Definition: crc.c:55
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
Definition: inszt_fsk.c:13539
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
void DRV_TMR2_Initialize(void)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)